Results 1 to 4 of 4
Hi ,
I have written following statement to get the value from a footer file
LCNT2=`awk -F "|" '{ print $2}' footer.txt`
but its giving an junk value while I ...
- 03-22-2007 #1Just Joined!
- Join Date
- Feb 2007
- Posts
- 18
awk command Error
Hi ,
I have written following statement to get the value from a footer file
LCNT2=`awk -F "|" '{ print $2}' footer.txt`
but its giving an junk value while I am testign thru Shell scripting
Error is:
+ LCNT2=$'9\r'
which is supposed to be 9.
Can you please help me out,
Many Thanks,
Vishnu
- 03-22-2007 #2Just Joined!
- Join Date
- Feb 2007
- Posts
- 18
could any one please help me out! I am all most stuck with this issue.
Many Thanks,
Vishnu.
- 03-22-2007 #3
There's a carriage return appended to the value.
Try:
to strip it.Code:gawk -F "|" '{ sub("\r$", "", $2); print $2}' footer.txt
- 03-22-2007 #4Just Joined!
- Join Date
- Feb 2007
- Posts
- 18
Thanks a lot for your help! its working..
Kind Regards,
Vishnu.


Reply With Quote