Link to home
Start Free TrialLog in
Avatar of SINCO
SINCOFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Change value in an indexed text file

I have indexed text file with data as follows:

0 3051
1 0
2 0
3 0
4 0
5 0
6 0
7 0
8 0
9 0
10 10
11 1
12 25
13 1
14 1000
15 2
16 3
17 20
18 0
19 0
20 -49.73201

How can i change individual values without messing up the index number?

Thanks.
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

read the file and rewrite it with the values changed
Avatar of SINCO

ASKER

Yeah, well done. But how do I change the value. Eg. how do i change the value corresponding to index 15 from 2 to 6?
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SINCO

ASKER

I like it. Looks simple. I'll accept yr answer when I get it to work. Thanks
Avatar of SINCO

ASKER

Great, it works. But using OpenTextFile. Thanks again dude.
Glad I could help, sorry for the wrong function name (As I don't have vb here....)

the first comment was to start the direction, so I could detect what your level of understanding of the situation was...