Page 1 of 1

csv import into database

Posted: Thu Apr 28, 2011 6:22 am
by johnghng
I have a batch of text files that need to be regularly importe into an sql database
the only strange thing is that there is a header which looks like :
10|2|6/1/2010 12:00:06 PM|PreExistingCond|PreExisting Condition Letter|||D

or

10|4|8/23/2010 1:28:02 PM|DETO|Dependent Over Age Limit|DETO|DETO|D

after that, it is a | deliminated file.
I need to do an import that will look for the field containing PreExisting Condition Letter or Dependent Over Age Limit and then use that to fill a field for every line imported from that text file.

Each text file has a header like that followed by rows of | deliminated address informatoin. That area determines the type of letter to be sent, so that needs to be repliccated to the last column called lettertype before the import. There is no column header information in the file, so columns are determined by their position.
Any help would be appreciated.

Re: csv import into database

Posted: Thu Apr 28, 2011 1:15 pm
by DataMystic Support
With everything here inside a Filters\Restrict\Each line in turn;
Use a Filters\Restrict\Delimited fields (CSV, Tab, Pipe, etc) to capture the desired field to a Filters\Special\Capture text.
Then, use a Add right margin filter to add the captured data (with a preceding |) at the end of the line.