|
Post by votan on Sept 5, 2008 16:54:24 GMT -5
How can I delete some entries from a file? For example, I have a text file containg entries like this:string1,2313 string2,5454 string3,6576 Now I want to delete all entries from the file that have a second value lower than 6000.... without leaving any empty lines or so...
|
|
|
Post by Psycho on Sept 5, 2008 18:17:19 GMT -5
I would read all the data from the text file into an array. Then, re-write the data from the array to the text file while running through a check that skips any value outside of your desired range.
The example below uses simple data and prints to the screen, but the concept should be what you need.
'Code start dim num(8) for x = 1 to 8 read num(x) next x
for x = 1 to 8 if num(x)>6000 then print num(x) end if next x
data 3320, 2456, 7654, 1400, 8980, 3434, 7000, 9000 'Code ends
Hope this helps.
Psycho
|
|