jsag
07-30-2010, 06:52 PM
Sorry if this is in the wrong section, and I searched and tried things for hours before posting.
I have hundreds of .txt files named eg:
013929.txt
145678a.txt etc etc
Inside each text file is like this eg:
QKAE6K
Full Name Of Item
blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah blah
etc
I need to write a script that can open each file in the folder and take the first line EG: QKAE6K
and then add a minus and then add the second line of text EG:
So the above example would look like...
QKAE6K-Full Name Of Item
Then rename the text file to that EG QKAE6K-Full Name Of Item.txt
If anyone can help, please help a n00b out. I've tried for a day now editing scripts I find online and have just rage binned them to sulk at how stupid I feel.
I'm sure this must be simple to someone reading, please help.
I will try again searching, reading and trying and if I get it working I'll re-edit this post.
I have hundreds of .txt files named eg:
013929.txt
145678a.txt etc etc
Inside each text file is like this eg:
QKAE6K
Full Name Of Item
blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah blah
etc
I need to write a script that can open each file in the folder and take the first line EG: QKAE6K
and then add a minus and then add the second line of text EG:
So the above example would look like...
QKAE6K-Full Name Of Item
Then rename the text file to that EG QKAE6K-Full Name Of Item.txt
If anyone can help, please help a n00b out. I've tried for a day now editing scripts I find online and have just rage binned them to sulk at how stupid I feel.
I'm sure this must be simple to someone reading, please help.
I will try again searching, reading and trying and if I get it working I'll re-edit this post.