FileSeek?

 

hello everyone, I can't seem to figure out how to Flile_Seek Specific Points.

eg. I'll have a file like this:

1.5;0.56;5

2.2;0.66;8

0.3;0.75;5.2

 

and I want to Get the second line down, and third deliminated number across. (8)

i take it it should look something like this (Error handleing not shown for clairity):

int FileHandle;
int Delimination = 3;
int LinesUpDown = 2
double value;

FileHandle=FileOpen("Three.txt", FILE_CSV|FILE_READ, ';');
//????   FileSeek(FileHandle, Delimination, LinesUpDown);  ?????//
value=FileReadDouble(FileHandle,DOUBLE_VALUE);
FileClose(FileHandle);

Alert (value," < This is the value your looking for *jedi hand wave*);

but i know that Wont work becouse the second value int FileSeek is mesured in bytes (characters) not deliminations, and the third number is suppose to be a constant like SEEK_CUR, SEEK_SET, and SEEK_END.

does anyone know of a way to do this? Thank you in advance

 
Just read the data you don't want and throw it away,  then you will be at the data you do want and can read i and keep it. FileSeek() is usually used with binary (BIN) files.
 

RaptorUK:
Just read the data you don't want and throw it away,  then you will be at the data you do want and can read i and keep it. FileSeek() is usually used with binary (BIN) files.  

Thank you :) sometimes I'm thinking to complex to see the simple answer. though perhaps not the most elegant way to do it, that will work just fine for me, thank you ^.^ cheers.
 
nickblack:
Thank you :) sometimes I'm thinking to complex to see the simple answer. though perhaps not the most elegant way to do it, that will work just fine for me, thank you ^.^ cheers.
You can do elegant later once you have functional working.
Reason: