Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Would Like to Automate Batch File Creation and Text FIle Import

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. 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 appends ".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 concatenates all the text
files in one file say "all.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 and 5th 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 this command seems to fail if "DOS" can't find one of the
files.

**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
pinchpa I: \\change05.net.company.org\st_inc Microsoft 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.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Would Like to Automate Batch File Creation and Text FIle Import


socrtwo wrote:
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. 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 appends ".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 concatenates all the text
files in one file say "all.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 and 5th 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 this command seems to fail if "DOS" can't find one of the
files.

**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
pinchpa I: \\change05.net.company.org\st_inc Microsoft 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.


I just read that /c suppresses errors with the copy command.

Also it might be useful for the copy command to search subdirectories
for the files, does /s do that?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Would Like to Automate Batch File Creation and Text FIle Import


socrtwo wrote:
socrtwo wrote:
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. 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 appends ".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 concatenates all the text
files in one file say "all.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 and 5th 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 this command seems to fail if "DOS" can't find one of the
files.

**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
pinchpa I: \\change05.net.company.org\st_inc Microsoft 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.


I just read that /c suppresses errors with the copy command.

Also it might be useful for the copy command to search subdirectories
for the files, does /s do that?


Oops, I was look ing xcopy. Can I use that instead of copy?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"