Help with Array Usage
- From: Deepu <pradeep.bg@xxxxxxxxx>
- Date: Sat, 16 Aug 2008 14:23:50 -0700 (PDT)
Hi All,
I need some help on how i can proceed for the question below.
I have a file <test.txt> with the contents as below:
test 1 1 0
testa 1 1 0
test 2 2 0
test 1 2 0
test 2 3 0
testb 2 2 0
testc 3 3 0
test 2 4 0
test 3 3 0
Next i need to get the 'unique' numbers in the first column for the
row which starts with 'test'.
Next i need to overwrite the same file <test.txt> with the same
contents as above and in addition i need to add a line like 'testfinal
1 0 0' for the unique numbers.
Example Output file <test.txt>:
test 1 1 0
testa 1 1 0
test 2 2 0
test 1 2 0
test 2 3 0
testb 2 2 0
testc 3 3 0
test 2 4 0
test 3 3 0
<-- New lines below-->
testfinal 1 0 0
testfinal 2 0 0
testfinal 3 0 0
Thanks for the help.
.
- Follow-Ups:
- Re: Help with Array Usage
- From: siva0825@xxxxxxxxx
- Re: Help with Array Usage
- From: Tad J McClellan
- Re: Help with Array Usage
- From: Jürgen Exner
- Re: Help with Array Usage
- Prev by Date: Re: List Context in a Boolean Expression
- Next by Date: Re: array comparision
- Previous by thread: FAQ 5.19 How can I reliably rename a file?
- Next by thread: Re: Help with Array Usage
- Index(es):
Relevant Pages
|