Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parsing a test file correctly

Status
Not open for further replies.

ChrisB45

IS-IT--Management
Aug 17, 2012
2
US
I'm trying to parse information from a fax log file that has 49 tab delimited field columns.
here is an example of what the text file contains:

Note: due to the length of each line, I'm showing only partial line information.
Also, the first line is column names.

"JobID" "ParentJobID" "SubmissionTime" "Scheduled" "Status" "ErrorDesc"
"0x0.." "0x2.." 7/20/2012 12:52:56 7/20/2012 12:52:56 "Completed" "Call completed"
"0x0.." "0x2.." 7/20/2012 14:55:09 7/20/2012 14:55:09 "Transmission error" "Busy"
"0x0.." "0x2.." 7/24/2012 10:07:12 7/24/2012 10:07:12 "Transmission error" "No dial tone"
etc...

I'm trying to get an output to an HTML file that shows only rows where <> "Call Completed".
Also, there are several columns I dont need (like JobID, ParentJobID and some further down the row), therefore want to be able to parse out only required columns. Another issue I'm running into is some fields are empty and I can't get past those in any code I try.
Is there a way to parse only the columns I need and ignore those that are empty?

I would appreciate any advise.
 
I can't get past those in any code I try
What have you tried so far?
Have you tried to establish an ADODB connection, loading the file's contents into a recordset?
You could filter there or simply SELECT only the columns you want to begin with.

Cheers,
MakeItSo

“Knowledge is power. Information is liberating. Education is the premise of progress, in every society, in every family.” (Kofi Annan)
Oppose SOPA, PIPA, ACTA; measures to curb freedom of information under whatever name whatsoever.
 
Thanks for the response MakeItSo...

I was trying to use VBScript to get what I needed, however, your idea may be more feasible.
While the log file isn’t all that complex, the script I’ve been working on was turning into a monster!!
Thanks again.

Kind Regards,

Chris
 
I was trying to use VBScript to get what I needed, however, your idea may be more feasible
My idea does involve VBScript. [tongue]
A little googling for "VBscript ADODB recordset text file" produced this link as top result:

Check it out. Looks good to me as a starter.
:)

Cheers,
MakeItSo


“Knowledge is power. Information is liberating. Education is the premise of progress, in every society, in every family.” (Kofi Annan)
Oppose SOPA, PIPA, ACTA; measures to curb freedom of information under whatever name whatsoever.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top