[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: [sqr-users] (no subject)
To do this, you'd have to do the following:
1. Open the file for reading.
2. Open a temporary file for writing (could also use an array for
this!)
3. Loop through the input file and check each row. If it does NOT meet
the deletion criteria, write the record out into the temp. file or
array. If it does, just skip it.
4. After you're done, close both files.
5. Use "call system using" to delete the original file and rename the
temp. file with the original file's name. Or, if you went with an array
instead, just open the original file for writing, loop through the array
and write each record back into the file.
Note that if this is going to be run on a server, the above will NOT
work unless you implement some sort of file-locking mechanism. (So that
multiple people can run the program at the same time)
-----------------------------------------------------
James Harris
Junior Systems Programmer/Analyst
Information Technology Division
Frederick Community College
-----------------------------------------------------
>>> JAguir@lsuhsc.edu 4/22/2003 3:50:30 PM >>>
Hello all,
Is it possible to delete a row from a .txt file under a certain
criteria
thru an SQR while it is open?
Thanks,
José A. Aguirre
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users