replacing escaped characters with actual newlines and tabs

592 views
Skip to first unread message

James Craner

unread,
Oct 3, 2017, 3:46:08 PM10/3/17
to TextWrangler Talk
I feel like this is probably something very basic I'm overlooking, but I have a long string of text with literal and visible backslash-t (tab characters) and backslash-n (newlines).  So instead of a formatted multi-line page of text in columns, it's just one long massive string.  I paste it into TW...

I know that I can search in TW for a tab or newline...

But how do I convert all the visible "\t" and "\n" to actual tabs and newlines?  Like if I searched for "\t" what would I put in the "Replace" box?

Thanks for any advice!
-Jim

Christopher Bort

unread,
Oct 3, 2017, 5:56:33 PM10/3/17
to textwr...@googlegroups.com
for the tab characters, search string

\\t

replace string

\t

Similar for newlines.
--
Christopher Bort
<top...@thehundredacre.net>

Thomas Fischer

unread,
Oct 4, 2017, 6:09:59 AM10/4/17
to textwr...@googlegroups.com
Hello James,

the easiest way to get around backslashes in your search field ist to select the offending string and then go to the menu
Search —> Use Selection for Find.
This will take care of escaping the necessary characters, which can be quite cumbersome if you are using grep.
Christopher gave already the appropriate replace strings.

All the best
Thomas

--
This is the TextWrangler Talk public discussion group.
If you have a feature request or would like to report a problem,
please email "sup...@barebones.com" instead of posting here.
---
You received this message because you are subscribed to the Google Groups "TextWrangler Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to textwrangler...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages