trying to strip the first 4 char. of a file out via commandline

im kind alost. i beleave its a sed command. but i cant seem to find it in my book. can someone point me in the write direction.

i know this is extreamly sloppy. but this is what i did untill i can figure out how to manipulate the filename namespace.

an ls on the directory where this would run would return 2 file names:


for i in `ls | awk -F"." '{ print $1 }'|awk -F"2" '{ print $2 }'`; do
                mv q162$i.* HBFULR$i`date +%Y%m%d%H%M%S`.DAT

How about this:

for file in *
 newname=`echo $i | sed 's/^....//'`
 mv $file HBFULR${newname}`date +%Y%m%d%H%M%S`.dat

A little simpler...

thank ya once again.

yeah i really need to brush up o learn some sed.

thanks for the pointers tho.