![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Adding a columnfrom a specifit line number to a specific line number | Ezy | Shell Programming and Scripting | 2 | 05-12-2008 05:29 AM |
| Appending line number to each line and getting total number of lines | chiru_h | Shell Programming and Scripting | 2 | 03-25-2008 07:19 AM |
| delete records from a file | dsravan | Shell Programming and Scripting | 6 | 09-10-2007 06:49 AM |
| Hai delete the records | readycpbala | Shell Programming and Scripting | 1 | 02-16-2007 04:49 AM |
| awk - Number of records | suman_jakkula | Shell Programming and Scripting | 1 | 09-08-2006 05:13 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
delete records using line number(NR)
Hai
I have a flat file which contains more than 6 crore lines or records. I want to delete only one line, using line number. For example I want to delete 414556 th line . How to do this using sed or awk command. thanks |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
sed -n '414556!p' input.txt
|
|
#3
|
||||
|
||||
|
Code:
sed 414556d file>_file_&&mv _file_ file Code:
sed -i 414556d file |
|
#4
|
|||
|
|||
|
thank u.The script is working
|
|||
| Google The UNIX and Linux Forums |