Parsing a text file?

eDreams

Guppy
Hello - hoping to get some help here from the forums as I'm totaly lost on this matter.

I've got a program that spits out a text file on various events. I want this text to be stored in a DB as it is, but I also want to disect the text and dump the data in various tables.

These are very distinct keyword that can be used as 'lookups', even though some of them happen more than once in a text log.

Is there anyone here who know how to make this thing come true?
 
What you're asking for is definitely possible - the first thing that you'll need to do is open up the file using a CFFile and reading the contents into a variable.

Once it's in memory you can turn it into a list or array and play with it however you feel fit.

Hatton
 
You wouldn't mind throwing me a sample or something? I'm not that familiar with the methods you're speaking about but can quite fast grasp something when it's set in context ;)

Oh, by the way. I need to be able to upload that file to a DB using a form - just use copy and paste in a form. The array then has to disect it all from there (or while it's beeing submited to the DB).

Would appriciate any kind of help,
Thanks!
 
If you are interested I have an asp code that do somethoing similar... It reads a text file, splits the contents in lines and tabs and insert the content (not the file) into a db.
 
I would be more than happy to have a look at it. Maybe I can translate it over to CFM and get this thing roling on a pure CFM site, if not - I'll use your application with a bit of modifying, since it's already doing most of the stuff that I seem to be looking for :]
 
The code is too large to post it and I realy don't have the time to strip the unnecessary code, so, please send a pm with your mail address to mail you.
 
zaboss said:
If you are interested I have an asp code that do somethoing similar... It reads a text file, splits the contents in lines and tabs and insert the content (not the file) into a db.


Hi, I am new to this site. I am looking for possible improvements to the parsing program I wrote to parse through a text file that contains a unique character code in char(31) that determines how the rest of the line should be parsed out. I would like to use an array versus looking at each individual line itself and populating it into the database in the appropriate fields.

Any help is greatly appreciatated.
Thanks.
:D :typing: :ranger: :clap2:
 
Back
Top