I have a file that contains...
Number
--------------------
1
2
3
4
i want to print all the numbers after the hyphen ...
I have a file that contains...
Number
--------------------
1
2
3
4
i want to print all the numbers after the hyphen ...
$ nawk '/\-/,/NR/' a.txt
--------------------
1
2
3
4
$ echo "5" >> a.txt
$ nawk '/\-/,/NR/' a.txt
--------------------
1
2
3
4
5
If you dont have nawk, then use awk or gawk
its also printing the hyphen line...
If the first two lines of the file are definitely "Number" and "--------", then try this:
sed -n '3,$p' a.txt
Yeah thanks !! i got it what i really wanted ....
awk 'NR>2' input.txt
sed '1,/^-/d' infile
awk 'p;/^-/{p=1}' infile
{ read ; read ; cat ;} < infile
sed 1,2d