Hi,

Just using regex expression you could do it simply as:

t1.pl
----
use strict;
while(<>)
{
    print $_ unless /^\/\/$/;
}

if your db-file is t1.txt,you could do:

$ perl t1.pl t1.txt > outfile.txt


HTH


-----Original Message-----
>From: Cinzia Sala <[EMAIL PROTECTED]>
>Sent: Feb 28, 2006 10:13 PM
>To: beginners@perl.org
>Subject: separate input
>
>Dear all,
>       I would like to separate my input text DB-file into single files each 
>containing the information between the two separators "//"
>
>
>e.g.
>
>dog, cat, home
>home, dog, cat
>//
>pen, pencil, work
>//
>milk, water, wine
>wine, milk, water
>//end
>
>I have tried with this:
>
>do {
>     $/="//\n";
>     $record= <DBFILE>;
>     print $record;
>     }    until ($/="//end");
>
>
>but it prints only:
>
>dog, cat, home
>home, dog, cat
>//
>
>How can I print in separate files the other records?
>
>Many thanks for this help
>
>Cinzia
>
>
>-- 
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
><http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>


--
Jeff Pang
NetEase AntiSpam Team
http://corp.netease.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to