Hello,
I have some \r characters I would like to remove.
I have tried replacing \x0D but that doesn't work. When I view the file in binary mode I can see the X'0D' chars.
Thanks
Remove carrage return \r
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
Saving it as Unix does get rid of them(which is helpful), but is there a way to replace them using a regular expression?MudGuard wrote:Which style of Line endings do you have configured for saving the file?
(in Save-As-Dialog: File Format)?
If it is PC, then whenever you save, the \x0D are inserted automatically.
It needs to be Unix file format to not auto-add \x0D ...
Thanks
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm
It does work.
TextPad treats \x0D (carriage return) or \x0A (line feed) or \x0D\x0A as a line terminator, and doesn't include it as searchable text in the document (although if you are using regular expressions you can search for line terminator, whatever character sequence it is in the underlying file, with \n).
The Mac line terminator is \x0D.
The Unix line terminator is \x0A.
The PC line terminator is \x0D\x0A (because that's how Teletypes worked many decades before computers were attached to them).
So when you save a file in PC format TextPad terminates each line with \x0D\x0A.
TextPad treats \x0D (carriage return) or \x0A (line feed) or \x0D\x0A as a line terminator, and doesn't include it as searchable text in the document (although if you are using regular expressions you can search for line terminator, whatever character sequence it is in the underlying file, with \n).
The Mac line terminator is \x0D.
The Unix line terminator is \x0A.
The PC line terminator is \x0D\x0A (because that's how Teletypes worked many decades before computers were attached to them).
So when you save a file in PC format TextPad terminates each line with \x0D\x0A.