> ""Jonathan" == "Jonathan Mast" <[EMAIL PROTECTED]> writes:
"Jonathan> The line numbers are 4million to 4million + some odd hundred
thousand, just
"Jonathan> to give an idea of the size.
Sounds like you want a database, not a flat file. Time to migrate.
--
Randal L. Schwartz - Stonehenge
On Thu, 10 Apr 2008 16:35:14 -0400, Jonathan Mast wrote:
> perl -ne 'print if 20 .. 50' file looks perfect but I totally don't
> understand it
perldoc perlop:
In scalar context, ".." returns a boolean value. The operator is
bistable, like a flip-flop, and emulates the line-rang
On Thu, Apr 10, 2008 at 4:35 PM, Jonathan Mast
<[EMAIL PROTECTED]> wrote:
> Thanks for all the input.
>
> The head / tail solution would work, but isn't very scalable. I did
> something similar on another file of comparable size and it took a long time
> to complete.
>
> The line numbers are 4
Thanks for all the input.
The head / tail solution would work, but isn't very scalable. I did
something similar on another file of comparable size and it took a long time
to complete.
The line numbers are 4million to 4million + some odd hundred thousand, just
to give an idea of the size.
The se
or use sed!
To print lines 5 through 10:
sed -ne '5,10p'
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Chas. Owens wrote:
On Thu, Apr 10, 2008 at 12:24 PM, Jonathan Mast
<[EMAIL PROTECTED]> wrote:
Hi, I have a ~125MB file of which I want to read lines n thru n+x and write
those into a separate file. What is the best way to go about this?
Use the flip-flop operator* (..):
perl -ne 'print if $
Jonathan Mast wrote:
Hi,
Hello,
I have a ~125MB file of which I want to read lines n thru n+x and write
those into a separate file. What is the best way to go about this?
while ( ) {
# read and ignore up to n
last if $. == $n - 1;
}
while ( ) {
print;
last if $. == $
or use head and tail command
head -n50 file | tail -n30
On Thu, Apr 10, 2008 at 11:54 AM, Chas. Owens <[EMAIL PROTECTED]> wrote:
> On Thu, Apr 10, 2008 at 12:24 PM, Jonathan Mast
> <[EMAIL PROTECTED]> wrote:
> > Hi, I have a ~125MB file of which I want to read lines n thru n+x and
> write
> > t
On Thu, Apr 10, 2008 at 12:24 PM, Jonathan Mast
<[EMAIL PROTECTED]> wrote:
> Hi, I have a ~125MB file of which I want to read lines n thru n+x and write
> those into a separate file. What is the best way to go about this?
>
> thanks
>
Use the flip-flop operator* (..):
perl -ne 'print if $. ==
I think a simpler solution would be to use head and tail:
head -n x > file.txt
tail -n x-n file.txt > file2.txt
Xavier Noria wrote:
On Apr 10, 2008, at 18:24 , Jonathan Mast wrote:
Hi, I have a ~125MB file of which I want to read lines n thru n+x and
write
those into a separate file. What
On Apr 10, 2008, at 18:24 , Jonathan Mast wrote:
Hi, I have a ~125MB file of which I want to read lines n thru n+x
and write
those into a separate file. What is the best way to go about this?
Tie::File
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PRO
Hi, I have a ~125MB file of which I want to read lines n thru n+x and write
those into a separate file. What is the best way to go about this?
thanks
12 matches
Mail list logo