while read DAY TIME A B C D E TRASM RETR DR; do echo $DAY ${TIME%:*} NEWNAME${A//[^0-9]} $TRASM $RETR $DR; done < file3 2015-02-10 10:00 NEWNAME00 trasm:1266245958 retrasm:439137 dropped:36504 2015-02-10 10:00 NEWNAME04 trasm:1339998535 retrasm:86120 dropped:47549 2015-02-10 10:00 NEWNAME02 trasm:1362335738 retrasm:84469 dropped:48248 2015-02-10 10:00 NEWNAME01 trasm:1362335738 retrasm:84469 dropped:4824 2015-02-10 10:00 NEWNAME03 trasm:1362335738 retrasm:84469 dropped:4824