I’m having a problem with csv files. I’ve got the ffs/ffd setup and it works fine until it encounters a comma in a field (i.e. “,“word, word”,”). I can’t test for fields without quotes as there are only quotes on fields that contain text. Numeric fields do not have quotes.
Any advice would be greatly appreciated.
Can you provide the real record with which you’ve encountered trouble? Also, can you share your schema definition? I assume you’ve specified a quoted release character in your schema.
There are a few rules that need to be followed when creating a flat file. One reference that describes an approach is at http://tools.ietf.org/html/rfc4180
Numeric fields that contain a delimiter must be quoted. The quotes are not considered to be part of the data and will be stripped by the parser.
Here are rules that I’ve used that work with the FF parser in IS:
- Records are terminated by a record delimiter, including the last record.
- Each record contains one or more fields separated by a field delimiter.
- Empty trailing fields may be omitted (e.g. no need for ,)
- Each field may be enclosed with a quoted release character, typically ". These are not considered part of the data.
- If data within a field contains a field or record delimiter the field must be enclosed in quoted release characters.
- A quoted release character within a field must be preceded by another quoted release character. E.g. “aaa”|“b”“bbb”|"ccc"CRLF
DOH! I wasn’t using the quoted identifier.