Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
txt or .dat files
#1
if I have a txt file like this


1,1,1,1,1,1
1,2,3,3,2,1
1,4,4,3,4,1
1,3,4,6,5,1
1,1,1,1,1,1


how can I open this file change middle 4 on the 3rd line to a 7
like this

1,1,1,1,1,1
1,2,3,3,2,1
1,4,7,3,4,1
1,3,4,6,5,1
1,1,1,1,1,1

without rewritting the entire file
eminiscing about trapezoids in conjunction with stratospherical parabolas:

No questions asked.

www.stickskate.com
Reply
#2
You can, but it involves some calculations and opening the file as binary. Why don't you just create a binary file with direct access?
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#3
... and if that's too complicated, what's wrong with re-writing the whole file with one number change anyway? (depending if it's a small file, of course...)
Reply
#4
the idea was so that I didn't keep it in an array but held the numbers in the file
eminiscing about trapezoids in conjunction with stratospherical parabolas:

No questions asked.

www.stickskate.com
Reply
#5
Then you're best using what nath said Wink

Look up the QB help for GET, PUT and BINARY file mode.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)