hi all,
I am trying to extract SUBSTRINGS out of a string using ksh.
The string is "SAPR3K.FD0.FA.TJ.B0010.T050302"
I tried using
a= `expr substr $stringZ 1 2`
which is giving me a syntax error, donno why??
any ideas why its not working??
I also tried
echo "welcome" | awk '{ print substr( $0, 0, 4 ) }'
which is working but I want to have the resltant substring in a variable and process further.
tanx......
what EXACTLY are you trying to extract in the above examples?
pls give sample input and a desired output.
Hi, I am trying to get "10" as a variable and "02" as a variable.
i.e. Input string = SAPR3K.FD0.FA.TJ.B0010.T050302
and desired output string lets say v1 = 10 (at 21st position in the string)and v2 = 02(at 29th position)
I have n't seen any problem except
a= `expr substr $stringZ 1 2`
change it as
a=`expr substr $stringZ 1 2` # remove the space