LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-15-2006, 03:24 AM   #1
loopoo
Member
 
Registered: Aug 2005
Posts: 40

Rep: Reputation: 15
Delete the first row from a text file


Hi!

I need help on this following issue: i have a big 2 GB flat text file and i want to remove only its first line.
How can i do that ??


Thanks in advance!
 
Old 08-15-2006, 03:31 AM   #2
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
sed -n '2,$p' filename > newfile

which says "print from line 2 'til the end of file 'filename' and write to file "newfile'"


Last edited by BrianK; 08-15-2006 at 03:47 AM.
 
Old 08-15-2006, 03:57 AM   #3
loopoo
Member
 
Registered: Aug 2005
Posts: 40

Original Poster
Rep: Reputation: 15
thanks a lot, Bryan


chris
 
  


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
delete chunks or regions from text file - help K3vin Linux - Software 3 09-26-2005 03:57 AM
Delete line from flat text file in C zaichik Programming 6 01-26-2005 07:16 PM
C++ read csv file row into vector taban1 Programming 3 11-08-2004 03:01 PM
How to delete a line from a text file with shell script programming Bassam General 1 01-28-2004 09:51 PM
How do I select a row of info in a database file? 1rulesall Linux - Newbie 6 12-08-2003 09:27 PM


All times are GMT -5. The time now is 03:52 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration