LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-14-2005, 01:07 PM   #1
feetyouwell
Member
 
Registered: Dec 2003
Location: NC, US
Distribution: Novell Linux Eval (2.6.5)
Posts: 240

Rep: Reputation: 30
perl question: text editing


what's the perl script that can delete first two lines of a larget text file (4 gb)?
 
Old 03-14-2005, 01:34 PM   #2
WmRicker
LQ Newbie
 
Registered: Mar 2005
Location: Boston
Distribution: RHEL AS 3, Debian 3, AIX, Unix
Posts: 4

Rep: Reputation: 0
Deleting the first two lines without shifting everything is not usually possible.

perl -nle "print unless 1..2"

toss in -i.bak to do it in-place
 
Old 03-14-2005, 02:19 PM   #3
TheLinuxDuck
Member
 
Registered: Sep 2002
Location: Tulsa, OK
Distribution: Slack, baby!
Posts: 349

Rep: Reputation: 33
You might try investigating the perl module AnyData. I've never used it, and in fact only just learned of it, but perhaps it will allow you to do this. Of course, you'll need to understand a little about tieing.

If you do decide to play with this and get it working, it would be nice if you could post code so that others will have an example.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Editing text Files kool_kid Linux - Newbie 12 12-26-2004 11:21 PM
editing text files killertofu Linux - Newbie 2 10-15-2004 05:55 PM
Suggestions for text editing jackpotrobot Linux - Software 2 07-06-2004 04:08 PM
text editing machinemen Linux - Newbie 2 06-18-2004 04:38 AM
Text editing PhuckFonix Linux - Newbie 5 05-22-2004 09:19 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration