MacMost Q&A Forum • View All Forum QuestionsAsk a Question

How Do I Find and Replace Hidden and Special Characters In a Text Editor?

I use a number of apps and programs that export, and very often import, data as .csv’s. I desperately need a simple and efficient process for finding commas (“,”) and spaces (” “) and replacing them with what I have always called “paragraph marks” “¶” – I’ve just learned these are called PILCROWs.

I think I’ve learned that in the Apple world blank spaces, tabs, etc are called hidden characters. I wiould also very much like to be able to find and replace “special characters” e.g. EM dashes, copyright icons.

I really like the Notes app, but am getting the feeling that doing large find and replace operations using hidden and special characters might be stretching the app’s abilities. I’ve been using TextEdit but it too seems out of its depth.

I am hoping to avoid using MS Word as I really don’t think I need THAT big of a hammer to crack this nut. In the windows world all of the hidden and special characters could be recognized, found and inserted using their ANSI codes and variations thereof.

PS – I am a BIG fan of MacMost. I joyfully contribute monthly through Patreon. Thank you.

I want to export a spreadsheet or database as a CSV, open the CSV in a “text editor” and then quickly remove all of the delineating commas replacing them most commonly with a comma-space combination (e.g. “####,####” becomes “####, ####”) but maybe “#### — ####” (that’s an EM dash).
Jim Child

Comments: 2 Responses to “How Do I Find and Replace Hidden and Special Characters In a Text Editor?”

    2 years ago

    You can do a lot of this in TextEdit if you know how to use the more advanced features. You can search for some of these characters and replace them too.

    Note that you don't want to insert "paragraph marks" into a document. Those are just special symbols, like emoji and math symbols. What you want is to insert a line break character. That character, which is naturally invisible, is often represented by a shaded "paragraph mark." But it is just represented by that in various apps, it is not the same as the symbol character itself.

    See to learn how to use TextEdit to search for some of these characters. I think you can do everything you need in TextEdit.

    If you still find that TextEdit doesn't cut it, you can try another text editing app. I love cotEditor, which is free and in the Mac App Store. Another popular choice is BBEdit, which I also use, but it is expensive.

    Jim Child
    2 years ago

    As always you have provided more of an answer than I could have imagined. Your detailed explanation and demonstrations of using pattern search and replace is a real game-hanger. I had downloaded and installed cotEditor but will now be spending much more time learning Text/Edit before exploring further.

    Thank you again for sharing and your knowledge! Jim

Comments Closed.