computing
  • 0

Grep a String At Specific Position

  • 0

Hi,

I have a text file which contains thousands of record and each record has a length of 256 characters.

I need to grep for the lines containing the text 401055, starting at column 9.

How do I achieve this with grep or egrep command? I don’t want a shell script or awk to achieve this.

Thanks,
Balaji.

Share

1 Answer

  1. Do you know what grep stands for – Global Regular Expression Print. It means display all the text in the file that matches this pattern. If you don’t allow the shell or a Unix tool to limit the search, then you are out of luck and you have to live with the global return.

    Of course, I could be wrong.

    • 0