Question

I have text file with structure like this:

    123456789 , 1111111111 , 2222222222222 , xxxxxxx , zzzzzzz ,
    987654321 , 22222222222222 , 3333333333333333 , hhhhhhhhh , bbbbbbbbb ,
...

As you can see, delimiters are not at same place in second row, and rows bellow.

I need to use flat file as source, and fixed width format.

Fixed width format

How can i format columns to fixed width by delimiter for large file (>1GB)?

Preview should look like this (delimiters in same column):

123456789 , 1111111111     , 2222222222222    , xxxxxxx   , zzzzzzz   ,
987654321 , 22222222222222 , 3333333333333333 , hhhhhhhhh , bbbbbbbbb ,

With Notepad++ i can modify file to fixed width with TestFX -> TestFX Edit -> Line up multiple lines by (,). But Notepad++ cannot process large files.

Help, please.

Was it helpful?

Solution

Why not use a delimited format instead? Since your file is clearly not fixed width.

You can use a delimter of ',' and then trim the spaces off or use a delimiter of ' , '

Personally I would find the first to be less likely to cause problems later on.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top