Computing.Net > Forums > Unix > sed help

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

sed help

Reply to Message Icon

Name: Axgop
Date: March 18, 2004 at 07:44:26 Pacific
OS: AIX 5.2
CPU/Ram: ??
Comment:

I'm trying to sed a character out of a series of files. The character is the euro symbol in Windows, 128 on the character map I believe. In vi it's showing up as ^À. I've tried running:

sed "s/^À//" filein > fileout

but it doesn't work. Man pages and internet searches haven't helped me at all, or I'm just missing something.



Sponsored Link
Ads by Google

Response Number 1
Name: aigles
Date: March 18, 2004 at 08:00:19 Pacific
Reply:

Try this (128 dec = 200 oct) :

tr -d '\200' filein > fileout

Jean-Pierre.


0

Response Number 2
Name: Axgop
Date: March 18, 2004 at 08:04:53 Pacific
Reply:

Worked. Thanks.


0

Response Number 3
Name: Axgop
Date: March 18, 2004 at 08:29:51 Pacific
Reply:

What about the same effect using sed? There is also a new line after the character that also needs to go, so tr won't work entirely. I tried running:

sed "s/\o200//g" filein > fileout

as a test to see if sed has the same effect, but the character has remained with everything I've tried.


0

Response Number 4
Name: aigles
Date: March 19, 2004 at 02:31:47 Pacific
Reply:

Try this :

tr '%' '\200' < input_file| awk '1' RS="\200\n" ORS=""

awk '1' : short cut for "awk '{print}'
RS="\200\n" : Input record separator = Euro+NewLine
ORS="" : Output receord separator = nothing
==> RS is replaced by ORS

Jean-Pierre.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: sed help

Sed Help [/] www.computing.net/answers/unix/sed-help-/6762.html

sed help with variable length file www.computing.net/answers/unix/sed-help-with-variable-length-file/5632.html

awk/sed help www.computing.net/answers/unix/awksed-help/6553.html