At 18:38 +0100 on 07/29/2013, John Delacour wrote about Re: Searching for files of a particular line break type:

On 28/7/13 at 22:53, st...@shodgson.org.uk (Steve Hodgson) wrote:

Given a folder of text files is it possible to search which one are of a particular line break type - say Mac Classic (CR)?

If your directory is ³~/temp/textfiles/², run this script in Terminal to change carriage return to linefeed in all the files it contains:

cd; cd temp/textfiles; perl -pi.bak -e "s~\r~\n~g" *

The script will create a backup of the original.

JD


One warning. If you want to change CR to LF (as in this suggestion), you have to watch out for the CR+LF Line ending since just changing CR to LF will make this LF+LF. I am not saying that you will encounter that line ending combination but just that it is a valid one. A folder with a mix of Linux/Unix, Mac, and Windows text files can contain all 3 line endings and you have to be aware of this if you want to change one specific line ending to another.

--
This is the BBEdit Talk public discussion group. If you have a feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

--- You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.


Reply via email to