
-----------------------------------
Blade
Thu Mar 20, 2003 5:24 pm

getting certian parts of files
-----------------------------------
ok, i have to do this program, that gets only one part of a file...
i have 2 coloms listed
(underscores are spaces)
10____100
12____144
14____196
16____256

and so on
how would i get only the second colomn of numbers to use in my program? i need the second colomn to square root it and add it to a third colomn. (i know the square root is the first colomn, but thats what i need to do)

-----------------------------------
Tony
Thu Mar 20, 2003 5:28 pm


-----------------------------------
well the easiest way is to read both columns and just ignore the first one. Otherwise you'd have to figure out random-access (using read/write instead of put/get... there're some working programs with that posted on the board, you just have to look).

get word1 %ignore
put word1 %rewrite to new file
get word2 %2nd column
put word2 %rewrite
put word2**2 %calculate 3rd column

something like that

-----------------------------------
Blade
Thu Mar 20, 2003 5:31 pm


-----------------------------------
ah i see... i never really though of that :) 