views:

780

answers:

2

Really basic question I'm sure for the normal Mac user but;

I'm a very recent Mac convert and I want to do a quick operation on a file. I would normally do this in windows by doing a search for ';' and replace with '\n' in my favourite editor(Editplus) but this doesn't seem to work on the two editors I have installed (Coda, Espresso) on my mac. I have other ways of doing this but I figured it would be better if I understood why it wasn't working.

+5  A: 

I guess you have problems entering the replace string in the find dialog. If you want to enter a newline in any single line Cocoa text field, you have to press alt-return. Also works for tab.

Nikolai Ruhe
+1  A: 

You can do this on the command line in the Terminal with:

cat input | tr ";" "\n"  > output

cat prints the content of the file input, tr takes this output and replaces ; with \n and this is then written into the file output

seb