[H-GEN] Splitting up a text file

Adil, Kim - Brisbane (Maintenance) AdilK at transfield.com.au
Mon Aug 21 02:07:49 EDT 2000


[ Humbug *General* list - semi-serious discussions about Humbug and ]
[ Unix-related topics.  Please observe the list's charter.          ]

Excellent,

I'll give that a try.

Regards,
Kim Adil

> -----Original Message-----
> From:	Byron Ellacott [SMTP:bje at apnic.net]
> Sent:	Monday, 21 August 2000 16:06
> To:	'general at lists.humbug.org.au'
> Subject:	RE: [H-GEN] Splitting up a text file
> 
> [ Humbug *General* list - semi-serious discussions about Humbug and ]
> [ Unix-related topics.  Please observe the list's charter.          ]
> 
> On Mon, 21 Aug 2000, Adil, Kim - Brisbane (Maintenance) wrote:
> 
> > I had a look at the split function in perl, but again it appears to be
> > concerned with splitting a line rather than somehow being able to keep
> > paragraphs together that can be imported into a database.	
> 
> $para = 0;
> $/ = "\n\n";
> while ($line = <STDIN>) {
>   open FILE, ">para$para.txt" or die "can't create para$para.txt: $!";
>   print FILE $line;
>   close FILE;
>   $para++;
> }
> 
> something like that
> 
> -- 
> bje
> 
> 
> 
> --
> * This is list (humbug) general handled by majordomo at lists.humbug.org.au .
> * Postings to this list are only accepted from subscribed addresses of
> * lists 'general' or 'general-post'.

--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'.



More information about the General mailing list