Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, 1 invisible), 1,395 guests, and 12 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
how to read specific value from file #405959
08/11/12 14:31
08/11/12 14:31
Joined: Jul 2011
Posts: 69
P
pjotr987 Offline OP
Junior Member
pjotr987  Offline OP
Junior Member
P

Joined: Jul 2011
Posts: 69
halo guys,
my newest problem is to read a specific value from a file.
the problem is, this are random values with different length and some are negative. thatswhy a simple jumping to a position wont help me. here a small example what i mean:

text file:

0.56 1234.45 0 -87.45 98.4 -54 and so on

now i want read just the fifth value automaticaly. how to jump directly to its position and read it? has anyone an idea how to solve it?

thanks in advance

Re: how to read specific value from file [Re: pjotr987] #405960
08/11/12 14:39
08/11/12 14:39
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
A simple way is to use file_var_read and "waste" four calls to get the 5th variable.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: how to read specific value from file [Re: Superku] #405962
08/11/12 15:02
08/11/12 15:02
Joined: Jul 2011
Posts: 69
P
pjotr987 Offline OP
Junior Member
pjotr987  Offline OP
Junior Member
P

Joined: Jul 2011
Posts: 69
thanks for reply,
the same solution i tried already, but my file has couple of thousands of this values. to read sequentially till value 16754 takes too long. thatswhy i want to speed it up somehow.

Re: how to read specific value from file [Re: pjotr987] #405963
08/11/12 15:10
08/11/12 15:10
Joined: Apr 2008
Posts: 650
Sajeth Offline
User
Sajeth  Offline
User

Joined: Apr 2008
Posts: 650
http://msdn.microsoft.com/en-us/library/windows/desktop/ms724345(v=vs.85).aspx

Maybe this could be useful in your case? Or is there no way to change the format of the saved values?


Teleschrott-Fan.
Re: how to read specific value from file [Re: Sajeth] #405966
08/11/12 18:18
08/11/12 18:18
Joined: Jul 2011
Posts: 69
P
pjotr987 Offline OP
Junior Member
pjotr987  Offline OP
Junior Member
P

Joined: Jul 2011
Posts: 69
ok, since every dataset of mine contains 60 values i count now the bytes of each dataset and write them into a separate file. this way i can access the separate datasets directly by seeking in the data file using the byte information out of the additional file.

thanks a lot for help


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1