Hi,
I have an input string say for example:
ABC,DEF,IJK,LMN,...,XYZ
The above string is comma delimited. Now I have to extract the last part after the comma i.e. XYZ.
Hi,
I have an input string say for example:
ABC,DEF,IJK,LMN,...,XYZ
The above string is comma delimited. Now I have to extract the last part after the comma i.e. XYZ.
The AWK way:
# echo "ABC,DEF,IJK,LMN,...,XYZ" | awk -F"," '{print $NF}'
XYZ
=o)
The Perl way:
echo "ABC,DEF,IJK,LMN,...,XYZ" | perl -e '@x=split/,/,<>; print $x[-1]'
The SED way...
echo "ABC,DEF,IJK,LMN,...,XYZ" | sed 's/.*,\(.*\)$/\1/g'
--ahamed