Aug 1, 2008 #1 BIS Technical User Jun 1, 2001 1,893 NL Hallo, Suppose I have a file named jkl678%Km93 which looks like this: Subject: XX-Date Some text Some randon numbers more text how can I easily rename this file from 'jkl678%Km93' to 'XX-Date' (the text after the Subject: line)
Hallo, Suppose I have a file named jkl678%Km93 which looks like this: Subject: XX-Date Some text Some randon numbers more text how can I easily rename this file from 'jkl678%Km93' to 'XX-Date' (the text after the Subject: line)
Aug 1, 2008 #2 columb IS-IT--Management Feb 5, 2004 1,231 EU Code: for file in * do mv $file $(awk '/Subject/ {print $2}' $file) done It's a bit short of error checking etc... On the internet no one knows you're a dog Columb Healy Upvote 0 Downvote
Code: for file in * do mv $file $(awk '/Subject/ {print $2}' $file) done It's a bit short of error checking etc... On the internet no one knows you're a dog Columb Healy
Aug 1, 2008 Thread starter #3 BIS Technical User Jun 1, 2001 1,893 NL It does what I need - many thanks! Upvote 0 Downvote