[ ~]$ echo 'x25abcy26defz27ghif33jjj' | sed 's/\([a-z]\)\([0-9][0-9]*\)\([a-z][a-z][a-z]\)/\1 \2 \3\n/g'
x 25 abc
y 26 def
z 27 ghi
f 33 jjj
[ ~]$ sed --version
GNU sed version 4.1.5
On HP UX,
/home/->echo 'x25abcy26defz27ghif33jjj' | sed 's/\([a-z]\)\([0-9][0-9]*\)\([a-z][a-z][a-z]\)/\1 \2 \3\
/g'
x 25 abc
y 26 def
z 27 ghi
f 33 jjj
/home/->
Thanks Ankel. However, I have given only the sample data. My first column has 16 digit card number and so on. Your sed command considers for a single character wise.
Please tell us how to differentiate Name and Number.
Else, it will not be able to parse these records
Although below code does not do the job, it should be able to point you to the right direction once you can differentiate between Name and Number. Some regular expression will be required to sort this out
echo x25abcy26defz27ghi | sed 's/\([a-zA-Z]*\)\([1-9][0-9]*\)\([a-zA-Z]*\)/\1,\2,\3\n/g'
Why don't you provide at least one complete, unabbreviated record followed by exactly how it should be output. Also, take a moment to consider if there are any special cases that would require special handling. If there are any, include one complete, unabbreviated record for each of them.
Please keep in mind, for future help requests, that it would have saved everyone (including yourself) a lot of time if you had done this from the start.
I am extremely sorry for not providing the exact input. Since, I work for outsourcing I could not provide the data and copy from the client location to local system. However, I will try to provide the sample in same manner in my next reply.