Hi,
Anyone help me to print the lines from the flat file between 879th line number and 1424th line number.
The 879 and 1424 should be passed as input to the shell script(It should be dynamic).
Can any one give me using sed or awk?
I tried using read, and print the lines..Its taking too much time for bigger files.
Like this?
$> cat infile eins A zwei B drei C vier D fuenf E sechs F sieben G acht H neun I zehn J $> read A; read B; echo '-----------'; sed -n "${A},${B}p" infile 3 7 ----------- drei C vier D fuenf E sechs F sieben G
Any of these should work:
sed -ne "${start},${end}p" yourfile awk "NR >= $start && NR <= $end" yourfile perl -ne "print if $start .. $end;" yourfile
Hi Zaxxon and puldi Thanks a lot...I am getting exactly same result.