Hi everyone!
I have a field like that:
I need to keep
I don't know how to use the Capital character like a separator and how to keep only this one...
I guess sed could do something like that...
Thanks;)
Hi everyone!
I have a field like that:
I need to keep
I don't know how to use the Capital character like a separator and how to keep only this one...
I guess sed could do something like that...
Thanks;)
Using sed ....
# echo "xxxxyyyRfffhhhhh" | sed "s/\(.*\)[A-Z]\(.*\)/\1/"
xxxxyyy
# echo "xxxxyyyRfffhhhhh" | sed "s/\(.*\)[A-Z]\(.*\)/\2/"
fffhhhhh
#
Thanks,
Penchal
---------- Post updated at 04:50 AM ---------- Previous update was at 04:48 AM ----------
using awk
# echo "xxxxyyyRfffhhhhh" | awk -F'[A-Z]' '{print $1,$2}'
xxxxyyy fffhhhhh
Thanks!!
And how to keep the Capital character?
I tried sed "s/\(.*\)([A-Z])\(.*\)/\2/" but it didn't work... Do you have a solution?
---------- Post updated at 10:00 AM ---------- Previous update was at 09:54 AM ----------
sed "s/\(.*\)\([A-Z]\)\(.*\)/\2/" is working!!
Great thank you!
try this
$ echo "xxxxyyyRfffhhhhh" |awk -F[A-Z] '{printf "%s\n%s\n%s\n",$1,substr($0,length($1)+1,1),$2}
xxxxyyy
R
fffhhhhh