extract field of characters after a specific pattern - using UNIX shell script

Hello,

Below is my input file's content ( in HP-UX platform ):

ABCD120672-B21 1
ABCD142257-002 1
ABCD142257-003 1
ABCD142257-006 1

From the above, I just want to get the field of 13 characters that comes after 'ABCD' i.e '120672-B21'... . Could you please let me know the shell script that I have to use?

Thanks

Try this:

sed 's/ABCD\(.*\) .*/\1/'  file > newfile

Regards

Try this,

echo "ABCD120672-B21 1"|cut -c 5-16