4

A time-saving feature I often used while editing large text files (the kind used for batch processes of data exchanges, aka, "flat files" for feeds between multiple systems) was Notepad++'s extended Find/Change function where you can specify certain characters (such as tab, space, line feed, carriage return) in both the Find function and the Change function.

This is the detail on how it works:

Open the find/replace dialog. At the bottom will be some Search mode options. Select "Extended (\n \r \t \0 \x...)" In either the Find what or the Replace with field entries, you can use the following escapes:

  • \n new line (LF)
  • \r carriage return (CR)
  • \s space character
  • \t tab character

This would make it very easy to edit lists of information, changing files from comma to tab delimited, or files with spaces between into comma delimited, as well being easy to go from spaces to tabs (or visa versa).

Anyone happen to know which text editors running on Mac OS have this feature (or have plugins to add this functionality)?

  • 1
    I am a long time Vim user, so I'd just use Vim (or MacVim). But they do have a learning curve and if you don't have a background in using those, I'd look for another option first. Both Sublime Text and Atom are free editors for macOS and they have tons of functionality and good user base. Hope this helps. – Ambidextrous Aug 11 '18 at 0:10
  • Which editors have you already tried? apple.stackexchange.com/questions/208838/… might help as well – nohillside Aug 11 '18 at 9:27
  • I think @nohillside 's answer is a good one, but you might consider two other text editors that run under mac os: BBedit and Sublime Text 3 . Discussing text editors is roughly akin to starting a religious debate, so I won't say any more except that I have chosen Sublime Text 3. – Seamus Aug 11 '18 at 15:28
  • <shrug> TextMate. BBEdit. Sublime Text. – Marc Wilson Aug 11 '18 at 15:55
2

Text Edit which is available out of the box supports searching for special characters:

  • Access "find" functionality with Cmd-F
  • Click the small magnifying glass at the beginning of the entry field and select "Insert Pattern" (last entry)
  • Pick your pattern (and repeat if necessary)

enter image description here

  • Move the cursor to the replacement field to select a pattern there (or just copy/paste from the search field)

If you do a lot of text-based file processing it might help to spend some time to learn about basic Unix tools like awk, sed and friends. This would make thinks a lot easier on the long run.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .