: 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
- 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
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
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
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
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
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