Re: OT: a problem about text manipulation
- From: Hirofumi Saito <hi_saito@xxxxxxxxxxxx>
- Date: Wed, 1 Nov 2006 00:35:09 +0900
On Tue, Oct 31, 2006 at 04:18:31PM +0500, Yakov Hrebtov wrote:
Paul Smith wrote:
I am looking for an automatic way of transforming my text file intoYou may try this:
another one with the format
cat ./test.txt | awk '{print $1" "$2; print $1" "$3; print $1" "$4}' |
grep -v ' $'
$ awk '{for(i=2;i<=NF;i++)printf $1"\t"$i"\n"}' test.txt
That's all.
or, try this.
$ awk '{for(i=2;i<=NF;i++)print $1, $i}' test.txt
I think awk is the best solution for this problem.
Regards,
--
----+----1----+----2----+----3----+----4----+----5----+----6----+----7
Mail: hi_saito@xxxxxxxxxxxx
--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
- Follow-Ups:
- Re: OT: a problem about text manipulation
- From: Benjamin Franz
- Re: OT: a problem about text manipulation
- References:
- OT: a problem about text manipulation
- From: Paul Smith
- Re: OT: a problem about text manipulation
- From: Yakov Hrebtov
- OT: a problem about text manipulation
- Prev by Date: Re: fc6, livna and 'spurious' totem-xine update
- Next by Date: Re: mount doesn't mount on boot-up
- Previous by thread: Re: OT: a problem about text manipulation
- Next by thread: Re: OT: a problem about text manipulation
- Index(es):