![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Deleting lines in text file | hern14 | UNIX for Dummies Questions & Answers | 5 | 05-16-2008 03:03 PM |
| Deleting lines in a file | reachsamir | Shell Programming and Scripting | 2 | 05-29-2007 11:17 AM |
| Deleting last 2 lines from the file. | videsh77 | Shell Programming and Scripting | 4 | 04-06-2007 01:14 PM |
| Deleting Lines from .csv file | 009satya | Shell Programming and Scripting | 3 | 11-14-2006 03:41 AM |
| deleting lines in a log file | BG_JrAdmin | Shell Programming and Scripting | 2 | 08-22-2006 11:12 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Actually I have 8GB file which contains 200,000 records and I want to delete first 50,000 records without opening the file. At the same time I don't want to create another file once I delete the records because of space problem on server.
Is there any way I can delete 50,000 lines from 'abc.dat' and redirect output in the 'abc.dat' only. |
|
|||||
|
Records are potentially very different from lines. You could have your own delimiters and have a record spanning several lines. If each line is a single record, then you could still run the following command under ksh:
Code:
sed -n "50000,200000p" file_to_cut_lines_from | cat > file_to_cut_lines_from |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|