This is a little weird, and I'm new to TextWrangler - perhaps I'm
missing something? I tried to google for an answer but didn't see
anything in 5 minutes of searching.
I have some text separated with semi-colons, and I'd like to see each
bit of text on its own line for clarity.
If I enter ; for the Find term and \n for the Replace term, and choose
'Replace' or 'Replace and Find Next' and go through the file, the
semi-colon is replaced and the text segments are bumped down to the next
line as I would expect. If I show invisibles it is a gray character that
looks like a dash with a short downwards line at the right side. If I
hex dump the front document, it is 0x1D = 13 = CR. It does not matter if
I check 'Use Grep' or not. It does not matter what line ending I choose
at the bottom of the window.
If I enter ; for the Find term and \n for the Replace term, and choose
'Replace All' or 'Replace to End', the semi-colon is replaced and the
text segments are NOT bumped down to the next line. If I show invisibles
it is a red upside down question mark. If I hex dump the front document,
it is 0x1A = 10 = LF. It does not matter if I check 'Use Grep' or not.
It does not matter what line ending I choose at the bottom of the window.
I did not expect the inconsistency between Replace and Replace All. I
also did not expect the \n to convert to a newline if I didn't choose
'Use Grep', however I see in Help that there are Special Characters like
this used in Basic searching mode. But then I would expect the Replace
All and Replace to End to work the same as Replace.
If you think it is a bug, I'll submit it.
thanks in advance.
chris
> If I enter ; for the Find term and \n for the Replace term, and choose
> 'Replace All' or 'Replace to End', the semi-colon is replaced and the
> text segments are NOT bumped down to the next line.
Yeah, looks like a bug; I'm seeing it here too (10.6.2) Given how often I use \n I assume it crept in with 3.1
You can work around it by using option-return for the Replace string.
Cheers
>I have some text separated with semi-colons, and I'd like to see each
>bit of text on its own line for clarity.
For that purpose, use \r, not \n; you should see the desired
behavior in all cases.
R.
--
Rich Siegel Bare Bones Software, Inc.
<sie...@barebones.com> <http://www.barebones.com/>
Someday I'll look back on all this and laugh... until they
sedate me.
> For that purpose, use \r, not \n; you should see the desired behavior in all cases.
Oops—you're right, that's what I normally use.
cool, \r works better, thanks!
Now I think \n should work differently for Replace and Replace and Find
Next. It shouldn't be putting in 0x1D but 0x1A. :)
chris