Advertisement

12.11.2007 at 09:40AM PST, ID: 23016158
[x]
Attachment Details

Find Text within a text file, and use that to rename the file

Asked by super786 in VB Script, Miscellaneous Programming

Tags: text, file, rename

I have thousands of text files in a folder. Inside each of these text files, there is a specific section for Account Numbers, such as:

"ACCT#: 0729410181" (Notice the space after the ":")

I want a script that can scan through these text files and grab the account number, and then rename the file with the account number.

So in essence, file 'testname123.txt' becomes '0729410181.txt', and then move on to the next file in the directory and perform the same function and keep on till it reaches the end.

My filelist is huge (abt 8000 of them).

How would I do that? Start Free Trial
 
Loading Advertisement...
 
[+][-]12.11.2007 at 09:49AM PST, ID: 20451053

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.11.2007 at 10:11AM PST, ID: 20451233

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.11.2007 at 10:12AM PST, ID: 20451237

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.11.2007 at 03:24PM PST, ID: 20453852

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.11.2007 at 03:24PM PST, ID: 20453855

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: VB Script, Miscellaneous Programming
Tags: text, file, rename
Sign Up Now!
Solution Provided By: super786
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628