
sleuth
Enthusiast
Dec 8, 2000, 1:24 AM
Post #2 of 2
(419 views)
|
|
Re: I WANTE to Delet Record From CSV File
[In reply to]
|
Can't Post
|
|
use the next; function, <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> open(data, "file.csv"); while(<data> ){ ($field1, $field2, $ect)=split(/$dilimiter/, $_); if ($field1 eq "$the_line_to_delete"){ next; ##### skips that line when pushing } push(@new,$_); # push all the lines into @new } #now overwrite the file with the new info open(data_new, ">data.csv"); print data_new @new; close(data_new); close(data); </pre><HR></BLOCKQUOTE> I hope you can understand how to implement that. Don't be afraid to reply if you need me to go over it more, I'm just tired right now. Sleuth
|