We help IT Professionals succeed at work.
Get Started

Routine - From txt file to SQL (with parse)

337 Views
Last Modified: 2012-05-11
Experts,

As usual, I'm in need of some serious help that's probably extremely easy for all of you.  :)

Background:  In our enterprise, we have a vbscript that adds printers to user's workstations.  This script is run against a computer and reads a text file with a list of printers and associated room numbers, and based on the variable %computer% installs printers that are assigned to itself.

I've attached a copy of the text file that gets scanned by vb below.

Well...  I've taken this business logic to the next level, and designed a SQL database /vb script pair that mimics the original behavior of this script.  It's actually very slick, and I'm quite proud of myself.  :)  In saying that, I've normalized the crap out of the database, and split the text file you see below into 8 individual tables, including 2 lookup tables and a ton of 'views'.  (I've included screenshots of the new table layout).

So now comes my "I have NO idea how I'm going to do this" question that I need help with.

We have approx 45 sites that are doing business currently using the original vbscript / textfile solution.  I need to develop a "transitory" solution that will migrate everyone from the text file into the SQL database.

How would I write a script that could read the contents of what you see below, located at each one of the sites...  Into the SQL instance?  As they're ALL doing business the old way with the text files, I'm guessing I need to periodically read the file and inject any changes into SQL.

ANY ideas on this topic are more than welcome, and I appreciate any help that you guys can give.
Comment
Watch Question
Commented:
This problem has been solved!
Unlock 2 Answers and 5 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE