Re: data file reading and manipulate

From: Karl Heinz Buchegger (kbuchegg_at_gascad.at)
Date: 06/01/04


Date: Tue, 01 Jun 2004 11:40:07 +0200

Edo wrote:
>
> Hello
> I need some guide as to how to go about this,
> I have a coma-delimited data in a text file that I like to manipulate.
> The coma separates each column from the other and it has about 3000 rows,
> I need to go through each row and add the 3rd column value to the next
> if the first and second column values are the same as the next row first
> and second column values. e.g.
> 3 6 8
> 3 6 7
> 4 6 6
>
> I will need to get back data that looks like this
>
> 3 6 8 “remove this line and add the 8 to the 7 of the next row to be 15”
> resulting to
> 3 6 15
> 4 6 6
>
> can OO do this and hints, codes, guide, library, functions, info any
> thing please would enlighten I would appreciate.

With which part do you have problems.

Eg. Can you do the file reading on your own?
    Do you know how to deal with the commas in your file? (BTW: There are no commas
          in the text you have shown)
    Do you know how to write to a new file?
    Is there anything you have tried on your own but couldn't get it to work?
    (It is always easier for us if you show code you already have. In this way
     we can see your current knowledge and can adapt to that).

-- 
Karl Heinz Buchegger
kbuchegg@gascad.at