1

I have lots of data on text files. Basically it is on *.dat file, and a *.fid file with the same name contains column headers. Those .dat files can be opened with any text editor. Columns are are understandable in text editors. However, I cannot manage to build a logic to split them.

White spaces are not exact for every column to be delimited with. Some columns have no data at all and filled with white spaces as highlighted in the image.

I tried to split them with their width using SQL substring function. It's works. Nonetheless, it is not possible to do that for the tons of data that I have.

I need those columns to be separated as it shows on the text file by adding some delimiter, so that other program like MS Excel can read them.

Is it possible to split those columns somehow? Can some one help me on that please.

enter image description here enter image description here

  • 2
    It looks like a fixed width data file, Notepad++ has a CSV Lint plugin https://github.com/BdR76/CSVLint/ you can use that to automatically detect the columns and convert it to comma or semi-colon separated – BdR Dec 08 '21 at 23:35
  • 1
    In Notepad++ you can also use `ALT` + `SHIFT` + `cursor DOWN` (or up) to turn the textcursor into column mode select, and then just go down the entire file and type a comma or semi-colon to separate the columns – BdR Dec 08 '21 at 23:40
  • Thanks. It can do. But in my case it does not work perfectly. – Sobuj Akand Dec 14 '21 at 09:30

0 Answers0