Start a new topic

Varying numbers of columns

The transaction files that I download don't always have the same number of columns.  Specifically they don't include the tribute columns if there are no tribute gifts.

Is there a way for me to make just one IOM profile that will accommodate this?


Wayne,

You could potentially pre-process the file with the API and ensure that it always has the maximum number of columns possible. This could be done in the BeforeImport method.
Great, I didn't know if that triggered before the check on the # of columns.

Now my problem is that the columns that might be missing are in the middle of the list, so it is going to shift all of the other data.

Are you saying that I would need to open up the .csv file and add the columns to the file or that there is a way to "trick" IOM into thinking that there are more columns than there really are? Can I mess with the import object somehow to assign empty columns to those spaces or something?
Wayne,

You would need to open the CSV and rewrite it or write to a new file and then change the Import.ImportFile to the new file path. Take a look at Microsoft.VisualBasic.FileIO.TextFieldParser for reading csv and tab delimited files.
Login or Signup to post a comment