cancel
Showing results for 
Search instead for 
Did you mean: 

How to solve extra commas in CSV files in FCC..!!

Former Member
0 Kudos

Hi,

I have the CSV file with comma(,) separator which has around 50 fields. Among them there were some description fields which has comma (ex: karan,kumar) which has to come as a single field and comes as 51 fields instead of 50.

Due to this, im facing problem at File content conversion and it is failing with error " ERROR converting document line no. 8534 according to structure 'Header':java.lang.Exception: ERROR in configuration / structure 'Header.': More elements in file csv structure than field names specified!

We have around 10 fields which comes in this way.Any idea how to solve this issue?

Thanks

Deepthi.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Deepthi,

By any chance the "description" field is coming within any delimiter? If yes, then it's easy to handle.

For eg:- If the description field is "Kumar, Karan" with delimiter " ", then you can use xml.enclosureSign=" and xml.enclosureSignEsc=" " in your FCC.

If not, then you might have to change the FCC to FixedLength.

Just curious to know, how come this basic issue was not caught and the interface moved into Production?

Regards,

Neetesh

VijayKonam
Active Contributor
0 Kudos

this is really tough to handle. I dount if a solution exist unless you have another means of finding when a field would end. because Karan,Kumar is something that a program will never be able to distinguish as a single word.

Though its tough, I would suggest you to discuss the future problems and time wasted in troubleshooting, with your client and change the delimiter to an unusual signn like ~ or |.

VJ

Former Member
0 Kudos

>> If the description field is "Kumar, Karan" with delimiter " ", then you can use xml.enclosureSign=" and xml.enclosureSignEsc=" " in your FCC.

Thank you Neetesh. This solved my issue.

They are sending all the description fields in double quotes(" ") and enclosuresign helps in identifying and passing as a single entity.

former_member581827
Participant
0 Kudos

Hi Deepthi,

Have you used those xml.enclosureSign=" and xml.enclosureSignEsc=" " in your FCC.

Regards,

Chandra.

Former Member
0 Kudos

>> Have you used those xml.enclosureSign=" and xml.enclosureSignEsc=" " in your FCc

Yes chandra. It solved my problem.. Make sure to send all those strings in quotes, it will solve the problem.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Deepthi,

You said for 10 fields you have this issue. If you always get for all this 10 fields if the value is present or not like karan,kumar as the example. If you dont have kumar then are you getting , instead of kumar. If yes then add 10 more fields in source datatype and concat in mapping.

If they dont come then your layout is itself wrong. Then as suraj suggested go with fixed length or and adapter module should work for you. Even if it is in produciton to over come this issue you may need to change in development itself for fixed length or ask the soure file gusy not to put comma for karan and kumar.

Regards,

---Satish

prasannakrishna_mynam
Contributor
0 Kudos

Hello Deepthi,

The option here is use fieldFixedLengths instead of fieldSeparator. By this way evethough you have more fields in file than given filednames, it will not trigger any error. (But this one will still keep the commas which you might not need in the xml structure, though you can replace these in mapping anyway this is one solution )

enclosureSign option you can try, but you need do include the delimeter in you file structure, which is again a troublesum.

eg:- field1, | karan,kumar|,fieldn

In case you are familier with Adapter Module you can do it easily, but its a final option as far i am concern.

Regards,

Prasanna

former_member187339
Active Contributor
0 Kudos

Hi,

Unfortunately this is difficult to handle. Can't you go for some other field separators like ';'

Regards

Suraj

Former Member
0 Kudos

Hi Suraj,

Thank you for your response.

Even If I go with ';' Iam not sure whether the descriptions won't come with ';' value. Again I will be with the same problem.

Is there any way atleast to ignore those records? That will solve my requirement temporarly.

Whenever I find that more fileds were present in the file then I have to ignore those particular records and I have to continue processing with the remaining records.. Is it possible to do this?

Thanks

Deepthi

former_member187339
Active Contributor
0 Kudos

Hi Deepthi,

Then I will suggest that you use a delimiter liek # or ~ which will never come

When you use field separators you cannot ignore those fields

Can you go for fixed field length option? Then you will not have any problem

Regards

Suraj

Former Member
0 Kudos

>> Can you go for fixed field length option? Then you will not have any problem

This interface is already in production and we can't afford such a big change now.

former_member187339
Active Contributor
0 Kudos

Hi Deepthi,

>>This interface is already in production and we can't afford such a big change now.

oops!!

But if you know that the field length are fixed then this will not impact your XML structure. But can you say that the name field will always be say 25 characters long!!! I doubt.

another Alternative will be to use the enclosure sign as suggested above. But again you need to ask client to send files like that.

Third approach is to use some other separator which will never come in middle like ~ etc. But again client need to be convinced.

Sorry this is the maximum available options

Regards

Suraj