Parse files in directory/insert in database

Posted by jakesankey on Stack Overflow See other posts from Stack Overflow or by jakesankey
Published on 2010-05-22T19:39:20Z Indexed on 2010/05/22 19:40 UTC
Read the original article Hit count: 180

Filed under:
|

Hey there, Here is my dillema... I have a directory full of .txt comma delimited files arranged as shown below. What I want to do is to import each of these into a SQL or SQLite database, appending each one below the last. (1 table)... I am open to C# or VB scripting and just not sure how to accomplish this. I want to only extract and import the data starting BELOW the 'Feat. Type,Feat. Name, etc' line.

These are stored in a \mynetwork\directory\stats folder on my network drive. Ideally I will be able to add functionality that will make the software/script know not to re-add the file to the database once it has already done so as well.

Any guidance or tips is appreciated!

$$ SAMPLE= $$ FIXTURE=- $$ OPERATOR=- $$ INSPECTION PROCESS=CMM #4 $$ PROCESS OPERATION=- $$ PROCESS SEQUENCE=- $$ TRIAL=-

Feat. Type,Feat. Name,Value,Actual,Nominal,Dev.,Tol-,Tol+,Out of Tol.,Comment Point,_FF_PLN_A_1,X,-17.445,-17.445,0.000,-999.000,999.000,, Point,_FF_PLN_A_1,Y,-195.502,-195.502,0.000,-999.000,999.000,, Point,_FF_PLN_A_1,Z,32.867,33.500,-0.633,-0.800,0.800,, Point,_FF_PLN_A_2,X,-73.908,-73.908,0.000,-999.000,999.000,, Point,_FF_PLN_A_2,Y,-157.957,-157.957,0.000,-999.000,999.000,, Point,_FF_PLN_A_2,Z,32.792,33.500,-0.708,-0.800,0.800,, Point,_FF_PLN_A_3,X,-100.180,-100.180,0.000,-999.000,999.000,, Point,_FF_PLN_A_3,Y,-142.797,-142.797,0.000,-999.000,999.000,, Point,_FF_PLN_A_3,Z,32.768,33.500,-0.732,-0.800,0.800,, Point,_FF_PLN_A_4,X,-160.945,-160.945,0.000,-999.000,999.000,, Point,_FF_PLN_A_4,Y,-112.705,-112.705,0.000,-999.000,999.000,, Point,_FF_PLN_A_4,Z,32.719,33.500,-0.781,-0.800,0.800,, Point,_FF_PLN_A_5,X,-158.096,-158.096,0.000,-999.000,999.000,, Point,_FF_PLN_A_5,Y,-73.821,-73.821,0.000,-999.000,999.000,, Point,_FF_PLN_A_5,Z,32.756,33.500,-0.744,-0.800,0.800,, Point,_FF_PLN_A_6,X,-195.670,-195.670,0.000,-999.000,999.000,, Point,_FF_PLN_A_6,Y,-17.375,-17.375,0.000,-999.000,999.000,, Point,_FF_PLN_A_6,Z,32.767,33.500,-0.733,-0.800,0.800,, Point,_FF_PLN_A_7,X,-173.759,-173.759,0.000,-999.000,999.000,, Point,_FF_PLN_A_7,Y,14.876,14.876,0.000,-999.000,999.000,,

© Stack Overflow or respective owner

Related posts about c#

Related posts about vb