Parsing a file in Shell Script

Hi,

I have a requirement. I have an application which can take a file as inputs. Now the file can contain any number of lines. The tool has to pick up the first uncommented line and begin processing it.
For example the file could be like this:
#MANI123|MANI1234
#MANI234|MANI247
SENDIL204|SENDIL505
INPUT4|INPUT5.

Now the tool has to pick up only the third line as it is the first uncommented line i.e . SENDIL204|SENDIL505. How can I do this in a shell script

Thanks in advance

grep -v ^# filename

the logical first line becomes your actual first line

use

grep -v "^\#" tmp

you can pipe this output to while loop and then process accordingly

What is the need for "^\#" ?

Just "^#" would do. :slight_smile:

i have not tried to rectify your post

i tried in my way