On 1/25/07, Gopalarathnam Venkatesan <gopal@xxxxxxxxxxxxxxxxx> wrote:
baluk wrote:
i want to find out the first 30 characters in text file which has about
200 lines of text.i tried reading grep and sed but it seems to be little
above me..can any one help
Its quite easy using sed.
shell> sed 's/\(.\{30\}\).*/\1/
1q' FILE
or, if your system's sed supports the ``-e'' option, you can use:
shell> sed -e 's/\(.\{30\}\).*/\1/' -e 1q FILE