Google Answers Logo
View Question
 
Q: Need VBA for Batch File Import of Text Into Excel ( No Answer,   0 Comments )
Question  
Subject: Need VBA for Batch File Import of Text Into Excel
Category: Computers > Programming
Asked by: socr222-ga
List Price: $22.00
Posted: 20 Aug 2006 10:29 PDT
Expires: 22 Aug 2006 18:46 PDT
Question ID: 757869
We are migrating users from Novell server to Microsoft and we must 
preserve their drive mappings. 

I have a spreadsheet which lists between say 1 and 75 user names in
colmn D.  I have drive mapping files associated with most user names
that indicates
which drive mappings the user has set up on their machine.  I would 
like from Excel to (the cell addresses and directory names are little 
changed from actual specific needs): 

1. Create a batch file which takes the user names starting from cell 
D47 say up to cell D122 and append ".txt" to the end of the user name. 

2. The batch file would then look for a text file by by each user name 
in the say H:\DriveMappings Directory (and look in subdirectories too)
and merge all the text files in one file say "temp.txt."  This process
should not stop if Excel can't find a file with the name of say
username1.txt, but should just continue to the next one.*

3. Lastly the macro should paste this into say cell K251 by way of the 
text import wizard and to use spaces and colons (":") to parse the data 
into 3 columns while leaving the the 4th, 5th and 6th column un-imported, 
since these columns contain non-essential inofrmation such as "Netware" 
or "Microsoft Server." * 

*I just found out that a copy command could work for the concatenation, 
for instance: 

H:\>copy pinchpa.txt+sortgr.txt+h235gz1.txt all.txt 

However I need this to look through subfolders of a directory and
don't know how to instruct copy to do this.

**Note, each drive line is preceded in the drive mapping file by the 
user names so it would be in the in the form: 

pinchpa H:    \\change05.net.company.org\gz_inc  Netware Server
pinchpa I:    \\change05.net.company.org\st_inc  Microsoft Windows Server 
pinchpa S:    \\change05.net.company.org\gz_inc_shared 

etc. 

Thanks much for any help! 

It is not necessary for the colon to remain in the final data.
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy