hi
i have a file with these strings:
123_abc_X1116990
how to get rid of 123_abc_ and keep only X1116990?
I have columns of these:
123_abc_X1134640
123_dfg_X1100237
123_tyu_X1103112
123_tyui_X1116990
thx
hi
i have a file with these strings:
123_abc_X1116990
how to get rid of 123_abc_ and keep only X1116990?
I have columns of these:
123_abc_X1134640
123_dfg_X1100237
123_tyu_X1103112
123_tyui_X1116990
thx
sed 's/123_[a-z]*_//' file.txt
using Perl:
perl -pi -e 's/^\d+_\w+_//' file.txt
another sed variant
sed 's/^.*_//' filename
cut -d"_" -f3
Pretty straightforward.
one more variant
echo "123_abc_X1116990" |awk -F_ '{ print $3 }'