0

I have a file whose newline delimiter has been accidentally erased. Now I have a whole bunch of 216-character lines, all displaying on a single line. Using the fact that I know the lines will be fixed width, is there a (windows) tool which could insert a line break every 216 characters?

Alternatively, I can get a copy of this file as a CSV. Again, no linebreaks. But this time, I would have to insert a line break every 6 commas.

I have tried importing these to Excel as a CSV, but that requires me to scroll the entire width of the file, removing their line breaks, and inserting my own every 216 characters-- definitely not a solution.

1
  • You can write a PowerShell script to break it up and then write it out to a text file or CSV file. Jan 19, 2018 at 20:54

1 Answer 1

0

If you have or can get Perl, try out this command in your shell:

perl -C -nlE 'say $1 while (/(\G.{216})/g)' your_input_file

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .