Gamestudio Links
Zorro Links
Newest Posts
Help!
by VoroneTZ. 10/14/25 05:04
Zorro 2.70
by jcl. 10/13/25 09:01
ZorroGPT
by TipmyPip. 10/12/25 13:58
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 10/11/25 18:45
Reality Check results on my strategy
by dBc. 10/11/25 06:15
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (Quad, ozgur, Nymphodora), 7,674 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
joenxxx, Jota, krishna, DrissB, James168
19170 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 | 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