WC -Sx- Jones <[EMAIL PROTECTED]>
wrote:
> Jeff Westman wrote:
>
> > When I ran this
> >
> >$ perl -ne 's/|^NEWLINE^|^/\n/g;print' loadFile
>
> The program loads the ENTIRE loadfile and then splits characters
> at
> whitespace "between" characters and then prints every character
> followe
Jeff Westman wrote:
When I ran this
$ perl -ne 's/|^NEWLINE^|^/\n/g;print' loadFile
The program loads the ENTIRE loadfile and then splits characters at
whitespace "between" characters and then prints every character followed
by a newline.
So, how big is loadfile?
__Sx_
Paul Johnson <[EMAIL PROTECTED]> wrote:
> On Thu, Feb 19, 2004 at 04:36:55PM -0800, david wrote:
> > Jeff Westman wrote:
> >
> > > I'm trying to help out another developer with a mini-Perl
> script.
> > > He has a file that contains one very long line, about 28M in
> size.
> > > He needs to do a
Paul Johnson wrote:
>>
>> [panda]# perl -ne 'BEGIN{$/=\10} s/\|\^NEWLINE\^\|\^/\n/g; print'
>> [loadFile
>
> The trouble with this approach is that you will miss any separators
> which are split. Your example actually reads 10 bytes at a time, but
> using $/ is the right idea:
>
> perl -ple
On Thu, Feb 19, 2004 at 04:36:55PM -0800, david wrote:
> Jeff Westman wrote:
>
> > I'm trying to help out another developer with a mini-Perl script.
> > He has a file that contains one very long line, about 28M in size.
> > He needs to do a replacement of all occurances of
> >
> > |^NEWLINE^|
Jeff Westman wrote:
> I'm trying to help out another developer with a mini-Perl script.
> He has a file that contains one very long line, about 28M in size.
> He needs to do a replacement of all occurances of
>
> |^NEWLINE^|^
>
> to a literal newline (HPUX, 0x0a or "\n").
>
> When I ran thi
I'm trying to help out another developer with a mini-Perl script.
He has a file that contains one very long line, about 28M in size.
He needs to do a replacement of all occurances of
|^NEWLINE^|^
to a literal newline (HPUX, 0x0a or "\n").
When I ran this
$ perl -ne 's/|^NEWLINE^|^/\n/