Balaji
Balaji

Reputation: 1515

csv data with comma values throws error while processing the file through the BizTalk flatfile Disassembler

I'm going to a pick a csv file in BizTalk and after some process I wanted to update it with two or more different systems.

In order to getting the csv file, I'm using the default Flatfile Disassembler for breaking it and constructing it as XML with the help of genereted schema. I can do that successfully with some consistent data however if I use a data with comma in it (other than delimiters), BizTalk fails!

Any other way to do this without using a custom pipeline component? Expecting a simple configuration within the flatfile disassembler component!

Upvotes: 0

Views: 838

Answers (2)

Vikas Bhardwaj
Vikas Bhardwaj

Reputation: 1510

Since your schema definition has ',' as delimiter, flat file disassembler will consider the data with comma as two fields and will fail due to mismatch in columns. You have few options:

  • Either add a new field to schema if you know , in data will only be present in a particular field.
  • Or change the delimiter in flat file from , to |(pipe) or some other character so that data does not conflict with delimiter.
  • Or as you mentioned manipulate the flat file in a custom pipeline component, which should be last resort if above two are not feasible.

Upvotes: 1

DTRT
DTRT

Reputation: 11040

So, here's the deal. BizTalk is not failing. Well, it is, but that is the expected and correct behavior.

What you have in an invalid CSV file. The CSV specification disallows the comma in field data unless a wrap character is used. Either way, both are reserved characters.

To accept the comma in field data, you must choose a wrap character and set that in the Wrap Character property in the Flat File Schema.

This is valid:

1/1/01,"Smith, John", $5000

This is not:

1/1/01,Smith, John, $5000

Upvotes: 5

Related Questions