Hi Firends,
I wanted to extract the first record of the file which starst with character say "X". And I tried an awk command which works when i try to execute it individually:
awk 'substr($1,1,1)=="X"' inputfile.txt
But when I use the same command in my script for which I am passing the parameters, it extracts the first record and the last record:
awk 'substr($0,$1,$2)==$3' $File_Name >> /WorkingDirectory/Header_Trailor.txt
where $1 = Character Length
$2 = Character Position
$3 = Search String
Please help me on this regard. Suggessions will be helpful.
Thanks,
Ajay