Text files to database.

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

Glenn
Posts: 9
Joined: Wed Jan 23, 2013 8:54 pm

Text files to database.

Postby Glenn » Sun Mar 06, 2016 4:58 am

I would like to convert text files within directories into a database and wondered whether textpipe was the tool for the job.

More info: I have have 35 directories that each contain many, many sub-directories within sub-directories (18300 total). Each sub-directory has a text file in it that lists keyword terms. Is it possible for textpipe to parse these directories and text files and create an importable sql file that will create the database keeping the same structure and naming conventions as the current directory setup?

Grateful for any insight, thanks.

User avatar
DataMystic Support
Site Admin
Posts: 2154
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Text files to database.

Postby DataMystic Support » Thu Mar 10, 2016 11:10 am

Sure, you can grab the file contents by adding a

Filters\Add\File Header of

Code: Select all

insert into tablename (field1, field2) values ("


and a
Filters\Add\File Footer of

Code: Select all

", '@fullinputfilename" );


And set the secondary output filename to merge all data to a new file.

Then you'll have one file to process with all the file data + subfolder names.

Then you need to decide if you need to parse out the subfolder names further with an extra step.
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments


Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest