Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] What is and how to escape "RepIdx" in .csv file when converting to Json #71

SummerSun opened this issue Mar 19, 2019 · 5 comments


Copy link

I have to apologize first that this is not an issue but a question and you do a GREAT JOB of this package!

My question is I want to do the same thing with C#, but when read in the first line, I got so many "RepIdx". I searched around but have no clue what it is.

I uploaded my file and tried the conversion in you WebSite, it works like a charm! I tried to debug into the source code, no escaping related to the "RepIdx" kind of string. Could you please provide some hint here?

Copy link

I'm not sure where you saw RepIdx. Could you provide a screenshot here?

Copy link

@martindrapeau Thanks for replying!

This is the the first line of the source csv file I got:


There are so many fields with same name "RepIdx". And this is the result from your tool

    "RecordId": "***",
    "DataModelId": "***",
    "ADDRESS_LINE1": "***",
    "ADDRESS_LINE2": "",
    "ADDRESS_LINE3": "",
    "ADDRESS_LINE4": "",
    "POSTCODE": 11416,
    "CITY": "RIYADH",
    "COUNTRY": "***",
    "LATITUDE": "",
    "LONGITUDE": "",
    **"RepIdx": 0,**
    "NUTS1": "",
    "NUTS2": "",
    "NUTS3": "",
    "WORLD_REGION": "Middle East",
    "US_STATE": "",
    "COUNTY": "",
    "ADDRESS_TYPE": "***",
    "PHONE_NUMBER": "***",
    "FAX_NUMBER": "***",
    "WEBSITE": "***",
    "EMAIL": "***",
    "BVD_ID_NUMBER": "***",
    "BVD_ACCOUNT_NUMBER": "***",
    "NATIONAL_ID": 1010158683,
    "NATIONAL_ID_LABEL": "***",
    "NATIONAL_ID_TYPE": "***",
    "VAT_NUMBER": "",
    "ECB_FVC_ID": "",
    "ECB_MFI_ID": "",
    "TIN": ***,
    "LEI": "***",
    "COMPANY_ID_NUMBER": "***",
    "TICKER": ***,
    "ISIN": "***",
    "PREVIOUS_NAME": "",
    "AKA_NAME": "***"

Everything works so good with your tool, there is no duplicate key named "RepIdx". I am wondering, how did you get rid of the field "RepIdx"?

Copy link

Hi Summer,

Your CSV has duplicated keys RepIdx throughout. Currently CSVJSON collapses duplicate keys. That is indeed a bug. It should either report an error and ask you to make them unique, or, even better, it should make them unique itself.

Let me find an automatic solution to this problem.


martindrapeau added a commit that referenced this issue Mar 20, 2019
Copy link

Ok, the issue is now resolved. Here is the testcase demonstrating the fix. Notice that '__#' is added when duplicate column headers are detected.

Give it another go with your CSV file. Let me know if everything is resolved.

Copy link

Confirmed that it is resolved, I thought it was a feature 😂😂😂

Anyway, thank you! Really good package!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

2 participants