Re: Sed advice needed



Piers Kittel (debian@xxxxxxxxxx) wrote on Thu, 31 May 2007 17:05:04 +0100:

What's the best way to do this? I've been reading the man pages of
sed, cut and awk but I can't quite figure out how to do this. Any
ideas?

The sed man page is not very helpful I'm afraid. A pretty good manual is
here: <http://www.grymoire.com/Unix/Sed.html>.

Since you want to mask out various parts of your line you have to apply
sed to it various times, like this:

echo "your line" | sed (mask 1) | sed (mask 2) | sed (mask 3)

or, if your text comes from a file:

sed (mask 1) < yourFile | sed (mask 2) | sed (mask 3)

Hope this helps.

G. Heinrich



--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx



Relevant Pages

  • Re: Sed advice needed
    ... # Remove quotes ... I've been reading the man pages of sed, cut and awk but I can't quite figure out how to do this. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx with a subject of "unsubscribe". ... Trouble? ...
    (Debian-User)
  • Re: cli for iso files
    ... However, too steep a learning curve for me, I'm afraid. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ... Trouble? ...
    (Debian-User)
  • Re: etc partially deleted
    ... tar file you made before this happened, ... I am afraid I don't have that backup... ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx with a subject of "unsubscribe". ... Trouble? ...
    (Debian-User)
  • Re: Get the ip address without using "root"?
    ... Steve Kemp writes: ... awk can select the line and do the double split in one go: ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ... Trouble? ...
    (Debian-User)
  • Re: awk and date command
    ... awk -v DT=`date +%Y%m%d` program.awk record.txt ... Country: Australia ... Text or chat with friends inside Yahoo! ... To unsubscribe: ...
    (Fedora)