Scott,
I use CodeWright for stuff like this...presuming the IFS records don't
contain funky fields and are all character based this works like a
champ...also a nice full screen little text editor...
Don in DC
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [
mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Scott Klement
Sent: Friday, June 01, 2007 4:21 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: Deleting Records within a CSV file on the IFS
Hi Steve,
Do I have to read the original file and write it back out
excluding the records I don't want? Or is there a better way?
Yes, that's exactly what you have to do. Depending on the situation,
you may be able to use a utility like grep or awk to do it for you, but
one way or another, you're going to have to read the entire file and
write out a new file.
(Or use some kind of "field value" that identifies that a particular
line should be "skipped")
This is pretty much the way all text files work... in fact, almost every
computer document, aside from a database, works this way. (Actually,
databases work this way, too... except that they manage the "special
field values" under the covers so you never see them.)