On Mon, Sep 22, 2003 at 10:29:14PM +0100, Rob Dixon wrote:
> Daniel Liston wrote:
> >
> > John W. Krahn wrote:
> >
> > > Or you could pare that down a bit. :-)
> > >
> > > #!/usr/bin/perl
> > >
> > > #syntax: unfold.pl filename > newfilename
> > >
> > > @ARGV or die "usage: $0 filename\n";
> > >
Daniel Liston wrote:
>
> John W. Krahn wrote:
>
> > Or you could pare that down a bit. :-)
> >
> > #!/usr/bin/perl
> >
> > #syntax: unfold.pl filename > newfilename
> >
> > @ARGV or die "usage: $0 filename\n";
> >
> > $/ = ''; print for grep [ chomp, s/\n\s+/ /g, s/\z/\n\n/ ], <>;
>
> I like that
Daniel Liston wrote:
Here is a tool I use to unfold long lines in LDAP outputs. It
also works on mailboxes that have the Received: lines or
Content-*: lines folded.
There are two things in your code that may cause a problem.
#!/usr/bin/perl
#syntax: unfold.pl filename > newfilename
if ($AR
Rob Dixon wrote:
>
> John W. Krahn wrote:
> >
> > my @records = do {
> >local ( $/, *FILE ) = '';
> >open FILE, $ARGV[0] or die "can't open $ARGV[0]: $!";
> >grep chomp, ;
>
> This will drop the last line of the file if there is no
> terminating separator.
>
> grep {chomp, 1} ;
Or
John W. Krahn wrote:
>
> Daniel Liston wrote:
> >
> > Here is a tool I use to unfold long lines in LDAP outputs.
> > It also works on mailboxes that have the Received: lines
> > or Content-*: lines folded.
>
> There are two things in your code that may cause a problem.
>
>
> > #!/usr/bin/perl
> >
Daniel Liston wrote:
>
> Here is a tool I use to unfold long lines in LDAP outputs.
> It also works on mailboxes that have the Received: lines
> or Content-*: lines folded.
There are two things in your code that may cause a problem.
> #!/usr/bin/perl
>
> #syntax: unfold.pl filename > newfilen
Here is a tool I use to unfold long lines in LDAP outputs.
It also works on mailboxes that have the Received: lines
or Content-*: lines folded.
#!/usr/bin/perl
#syntax: unfold.pl filename > newfilename
if ($ARGV[0]) {
local $/ = '';
open(FILE, "<$ARGV[0]") or die "can't open $ARGV[0]: $!\
Rob Dixon wrote:
>
> Rajeev wrote:
>
> > my $seperator = '/(?m:^\s*\n$)/';
>
> It will match the following sequence:
>
> - an optional open parenthesis
> - a lowercase 'm'
> - a colon
> - the start of a new record
> - zero or more whitespace characters
> - a newline
> - the end of a record
Just a
Rajeev wrote:
>
> Hi Rob,
>
> I have written a routine here .. not exactly whay u told.. before that I have a
> problem with regex..
>
> I want to pass the regex on which the splitting (or record separation logic in my
> code) will happen such that I can call the same
function with different reco
"Pandey Rajeev-A19514" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi Paul,
>
> I has tried the $/ = ""; but it did not work because my logfile itself was faulty.
> The problem is that between two paragraphs, the empty line does not match /^\n$/ but
> it matches some spaces too
ubject: Re: Problem with input record separator
On Sun, Sep 21, 2003 at 04:11:30PM +0530, Pandey Rajeev-A19514 wrote:
> I am stuck with input record separator
You are correct that you should be changing the IRS ...
> I have a
On Sun, Sep 21, 2003 at 04:11:30PM +0530, Pandey Rajeev-A19514 wrote:
> I am stuck with input record separator
You are correct that you should be changing the IRS ...
> I have a file .. say "abc"
>
> ***
>
>
> AAA
Hi ,
I am stuck with input record separator
I have a file .. say "abc"
***
**
13 matches
Mail list logo