CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced:
I WANTE to Delet Record From CSV File

 



webhay
Novice

Dec 7, 2000, 5:06 AM

Post #1 of 2 (721 views)
I WANTE to Delet Record From CSV File Can't Post

i Write Pro That Add to CSV File but i Want to Delet Record From This File ......


Please help
haytham

------------------
Haytham Taher


sleuth
Enthusiast

Dec 8, 2000, 1:24 AM

Post #2 of 2 (721 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

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives