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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I export Procomm Data to a Database?

Status
Not open for further replies.

countdrak

Programmer
Jun 20, 2003
358
US
Now that I have captured the file, I have to use it.
I am trying to convert the .cap file into a database so I can use it to do some sort of data analysis.

My boss asked me to look at various software tools, like Monarch by Datawatch. But I found these tools really complicated for something that I want to do.

Does anyone have any ideas how I can export the data into a table and into user defined columns?

I have tried using various text parsers, but couldnt get them working because the Procomm file doesnt have delimters.

Thanks for the help.
 
If the data is in some sort of regular format, i.e. field1 always takes up 10 characters, field2 takes five, and so on and they always appear in the same place in the file, here's one suggestion. Open the .cap file (with the fopen command), read line by line (using fgets), then use some string commands such as substr or strtok to get each field you want. Once you have done that, then create a second output file where you write each record out in CSV format as most any database should be able to read that just fine.


aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top