I need to extract a value from a text file into a ksh script, and change the last two letters to "00". awk gets the right value (2500 in this example), but the variable has no value.
I use the following command:
StartTime=expr nawk 'NR==20 {print $11;exit}' $New_FILE
echo 1 $StartTime mytime
$StartTime=`echo $StartTime | sed -n -e "s/30/00/" -e "p"`
where $New_FILE is the text file name.
What I get is:
2500
,1 mytime
Main[46]: =: not found
sure.
Here is the input file (without the header lines).
I need to extract a parameter $11 from line 20 and use it as a variable $StartTime in the code. (In this file it is 2500)
NOMV TV ETIQUETTE NI NJ NK \(DATE-O h m s\) IP1 IP2 IP3 DEET NPAS DTY G IG1 IG2 IG3 IG4
0- HSO3 P AURV1.31WFLX 160 210 1 20070601 000000 0 2500 0 900 100 R16 N 150 200 23936 37973
1- HPXA P AURV1.31WFLX 160 210 1 20070601 000000 0 2500 0 900 100 R16 N 150 200 23936 37973
2- RPXA P AURV1.31WFLX 160 210 1 20070601 000000 0 2500 0 900 100 R16 N 150 200 23936 37973
3- SO4= P AURV1.31WFLX 160 210 1 20070601 000000 0 2500 0 900 100 R16 N 150 200 23936 37973