Hi:),
I am having 110 records in a file and I want to delete particular record (say 63rd) . Which command can be use to achieve this ?
in ksh you could have a script with: -
LINE=63
nawk -v ln=$LINE ' NR != ln { print } ' infile
or on the command line: -
nawk ' NR != 63 { print } ' infile
or to redirect to a file: -
nawk ' NR != 63 { print } ' infile > outfile
Hi,
sed -n '63!p' file
sed '63d' infile > outfile
or
sed -i '63d' inoutfile
The records need to be newline separated, and record 1 needs to be on line 1
Hi,
thankx for the solution . It working fine.
But i want to try this using 'WHILE' loop.
Suppose 10 records are there and I want to delete 5th and 9th records.