Machiaveli
Programmer
Hello,
I've posted this item before, but no really solutions to solve this.
I've some textfiles which i would like to import. In one textfile there are over 1024 columns when separated. This exceeds sql server's maximum columns. Let call this the resultfile.
In the other texfile i've got a descriptionfile about the resultfile. The description contains the columnnames of the resultfile (see below for example). The problem with the resultfile is that it doesn't contain any columnnames, but the columns appear in order of the descriptionfile.
The tricky part is that there are columns which really represents 1 column (those columns has the same name but with an indexnumber). Those columns need to be parsed, but there are some of those colums that doesn't need to be parsed.
For example (never mind the values):
field1_1 | field1_2 | field2 | field3
empty yes 1 2003
Above should be:
field1 | field2 | field3
yes 1 2003
Descriptionfile example:
formid fieldnr fieldname idx length
1 1 field0 0 2
1 2 field1 1 1
1 3 field1 2 1
1 4 field2 0 2
1 5 field3 0 4
Now there should be a way to transform the data so that the columns where no value is specified are parsed.
Can someone help me on this? This bustin my brains for weeks.
I've posted this item before, but no really solutions to solve this.
I've some textfiles which i would like to import. In one textfile there are over 1024 columns when separated. This exceeds sql server's maximum columns. Let call this the resultfile.
In the other texfile i've got a descriptionfile about the resultfile. The description contains the columnnames of the resultfile (see below for example). The problem with the resultfile is that it doesn't contain any columnnames, but the columns appear in order of the descriptionfile.
The tricky part is that there are columns which really represents 1 column (those columns has the same name but with an indexnumber). Those columns need to be parsed, but there are some of those colums that doesn't need to be parsed.
For example (never mind the values):
field1_1 | field1_2 | field2 | field3
empty yes 1 2003
Above should be:
field1 | field2 | field3
yes 1 2003
Descriptionfile example:
formid fieldnr fieldname idx length
1 1 field0 0 2
1 2 field1 1 1
1 3 field1 2 1
1 4 field2 0 2
1 5 field3 0 4
Now there should be a way to transform the data so that the columns where no value is specified are parsed.
Can someone help me on this? This bustin my brains for weeks.