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.
Select the cells that you want to search. On the keyboard, press Ctrl + H to open the Find and Replace dialog box, with the Replace tab active. On the Replace tab, click in the Find What box. On the keyboard, press Ctrl + J to enter the line break character.
Open TextPad and the file you want to edit. Click Search and then Replace. In the Replace window, in the Find what section, type ^\n (caret, backslash 'n') and leave the Replace with section blank, unless you want to replace a blank line with other text. Check the Regular Expression box.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With