Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I reformat DOS text files to Unix ones?

dos files reformat text Unix
0
Posted

How do I reformat DOS text files to Unix ones?

0

Simply use this perl command: perl -i.bak -npe ‘s/\r\n/\n/g’ file … file is the file(s) to process. The modification is done in-place, with the original file stored with a .bak extension. Alternatively you can use the tr command: tr -d ‘\r’ < dos-text-file > unix-file dos-text-file is the file containing DOS text while unix-file will contain the converted output. This can be quite a bit faster than using perl.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123