Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] sed or awk or what?
- Date: Tue, 6 Aug 2002 09:42:14 -0400
- From: Viktor Pavlenko <vvp@example.com>
- Subject: Re: [tlug] sed or awk or what?
- References: <F231cGwM0OOJrzF5ldf00000923@example.com>
>>>>> "JI" == Jean-Christian Imbeault <jean_christian@example.com> writes: >> From: Sven Simon <sven@example.com> >> I have a file where I'd like to change the 9th field on the >> second line to, say, 70. Field seperator is space. I would JI> how about: JI> s/(.*) (.*) (.*) (.*) (.*) (.*) (.*) (.*) (.*)(.*) /\1 \2 \3 JI> \4 \5 \6 \7 \8 70\10 A bit shorter (the first line prints three lines of numbers) $ for i in `seq 1 3`; do seq -s ' ' 30 10 120; done | perl -pe '$.==2 && s/((\S+\s){8})(\S+)/${1}70/' 30 40 50 60 70 80 90 100 110 120 30 40 50 60 70 80 90 100 70 120 30 40 50 60 70 80 90 100 110 120 Viktor P.S. Sorry about the stupid mail I sent earlier about the s modifier. (Mr. Listmaster, can we erase it from the archives?:) It was the case when the mind clears next moment after the message has been sent...
- Follow-Ups:
- Re: [tlug] sed or awk or what?
- From: Josh Glover
- References:
- Re: [tlug] sed or awk or what?
- From: Jean-Christian Imbeault
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] sed or awk or what?
- Next by Date: Re: [tlug] searching but don't where to look!!
- Previous by thread: Re: [tlug] sed or awk or what?
- Next by thread: Re: [tlug] sed or awk or what?
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links