- Posts: 1
import if csv to sql
- john guillot
- Topic Author
- Offline
- User
Less
More
13 years 7 months ago #2108
by john guillot
import if csv to sql - Post(2108) was created by john guillot
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.
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.
Please Log in or Create an account to join the conversation.
- FlowHeater-Team
- Offline
- Admin
13 years 7 months ago #2109
by FlowHeater-Team
Best wishes
Robert Stark
Replied by FlowHeater-Team on topic Re:import if csv to sql - Post(2109)
It's possible but a bit tricky
I've made a little example; please have a look to the attachment import_header.zip.
The following steps are necessary
I've made a little example; please have a look to the attachment import_header.zip.
The following steps are necessary
- Create a new Definition and configure the READ TextFile Adapter without the option "The first row containing column headings"
- Then we need two .NET Script Heater and one Filter Heater to Filter the first line = the header line.
- The script in the first .NET Script Heater stores the certain header information for each other lines.
- The second script just handles to filter the first header row.
- The Filter Heater filters the header line.
Attachment import_header.zip not found
Best wishes
Robert Stark
Attachments:
Please Log in or Create an account to join the conversation.
Time to create page: 0.252 seconds