Fixing Fixed-Width Text Files
To remove the end line characters in a text file that has every line truncated at 80 chars…
perl -pi -e ‘s/(….+)\r\n/$1 /’ filename.txt
perl -pi -e ‘s/\n/\n\n/’ filename.txt
Then open in Write –> copy and paste into word.
About this entry
You’re currently reading “Fixing Fixed-Width Text Files,” an entry on Elegando
- Published:
- 07.18.07 / 9am
- Category:
- One Liners
Comments