Removing a comma with in a CSV file

I’ve got a third party system spitting a CSV file, unfortunatly it appears that sometimes the CSV file include a comma inside a field value like in the address field. “42, Melbourne House”

My constraints are the following :

  • The third party file format can’t be fixed so I will have to fix it in NAV

  • I currently use a dataport

So my question is : is there a way to tell the dataport to remove the , in a field value before it identify it as a field separator ?


Change your field separator other than Comma.

Kindly use fieldsepearator as TAB

In my file the field seperator is a comma and one of my constraint is that I don’t master the file being generated, it’s a comma and can’t be changed


You can open this file in Excel and then copy the data from that file to new workbook and save the file as Tab delimited.

or else you need to consult with thirdy party system owner to give the file in Tab delimited format.

In addition to TAB separators, they could also use double quotes around all of the fields. These are the FieldStartDelimeter and FieldEndDelimeter properties. Regardless, it’s almost impossible to fix this via code, and if you are you are making judgements about what the data should be. You will have to either fix the file yourself, manually, or have the customer change the way they generate the file. In my experience it usually ends up that you have to do the first.