troubleshooting Question

CSV export from databse parsing and manipulation

Avatar of rkeith2412
rkeith2412Flag for United States of America asked on
DatabasesWindows BatchVB Script
16 Comments1 Solution595 ViewsLast Modified:
I have a CSV file that I am creating with SQLPlus from an oracle databse.  The layout of the file is as follows:

"number","idType","state","country","IDnumber"

What I need to do is create a VB script or batch file to read the file and do the following:

if (idType == "1") { output to a new file "number","DL""state""IDnumber" }
if (idType == "2") { output to a new file "number","PA""country""IDnumber" }

So if my orignal file looked liek this:

123456789,1,TX,,12345
987654321,2,,US,54321

The new file would look like this:

123456789,DLTX12345
987654321,PAUS54321

Any help would be greatly appreciated
ASKER CERTIFIED SOLUTION
TakedaT

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 16 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 16 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros