Re: newbie: use CR in RE?

2003-11-24 Thread M.D. DeWar
: use CR in RE? Hello. Just want to know how to use special character in Regular Expression. I wish to remove all the carrier returns from a text file, I can use: tr -d \r text_file modified_text_file But if I do: sed -i s/\r//g text_file it actually removes all the character r from

Re: newbie: use CR in RE?

2003-11-24 Thread Ilya Varlashkin
- Original Message - From: Zhang Weiwu [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, November 22, 2003 8:00 AM Subject: newbie: use CR in RE? Hello. Just want to know how to use special character in Regular Expression. I wish to remove all the carrier returns

newbie: use CR in RE?

2003-11-22 Thread Zhang Weiwu
Hello. Just want to know how to use special character in Regular Expression. I wish to remove all the carrier returns from a text file, I can use: tr -d \r text_file modified_text_file But if I do: sed -i s/\r//g text_file it actually removes all the character r from the file. This is also a

Re: newbie: use CR in RE?

2003-11-22 Thread Jez Hancock
On Sat, Nov 22, 2003 at 09:00:26PM +0800, Zhang Weiwu wrote: snip This is also a problem in vi(1). Besides CR I wish to manipulate tabstops and line-feeds with RE too. I'm not sure about vi, but in vim this works: :%s/\n// to remove all newlines throughout a document. To substitute all

Re: newbie: use CR in RE?

2003-11-22 Thread Jerry McAllister
Hello. Just want to know how to use special character in Regular Expression. I wish to remove all the carrier returns from a text file, I can use: tr -d \r text_file modified_text_file But if I do: sed -i s/\r//g text_file it actually removes all the character r from the file. This

Re: newbie: use CR in RE?

2003-11-22 Thread Scott W
Jerry McAllister wrote: Hello. Just want to know how to use special character in Regular Expression. I wish to remove all the carrier returns from a text file, I can use: tr -d \r text_file modified_text_file But if I do: sed -i s/\r//g text_file it actually removes all the character r from

Re: newbie: use CR in RE?

2003-11-22 Thread Robin Schoonover
On Sat, 22 Nov 2003 10:44:30 -0500, Scott W [EMAIL PROTECTED] wrote: Jerry McAllister wrote: So why not just use tr? \t should get tabs, as you noted \r gets CRs I don't know linefeed off hand, but wouldn't be surprised if it was \l. It follows the usual conventions. There are more