30
Views
3
Comments
[CSVUtil] Large Number -100000000000000000000 is being converted to -1E+20
csvutil
Service icon
Forge asset by Wei Zhu
Application Type
Reactive
Service Studio Version
11.55.47 (Build 64439)

Hi everyone,

when loading a CSV file using LoadCSV2RecordList.One of the fields in my CSV contains a very large integer value :-100000000000000000000 (21 digits).
Even though this field is defined as Text in my Record List structure, and the CSV file does not use double quotes around the value, CSVUTIL is automatically interpreting it as a number and converting it to scientific notation:
→ -1E+20 
Question:
Is there a reliable way to force LoadCSV2RecordList to treat a field as strictly text, even when it looks like a number and no double quotes are used in the CSV? 
2024-04-03 15-32-55
Maxwell Mckinnon

Hi Aaron, 

im not well versed in this specific Forge asset, but are you producing CSV files using excel? If so, check the data type. In my experience uploading excel files, ive found that sometimes the data type in an Excel file can take presedence over your structure data type, so i would test making sure that particular cell/column is set to Text.

This may not be helpful in your specific case, but something to check

regards, 

Max

2024-07-12 05-57-50
Gourav Shrivastava
Champion

Hello @Aaron Kasab 

I haven't tried this, but I think you can try to put that value inside double quotes in the CSV or add a leading apostrophe (’) before the number, a common trick in CSV.


Like:-  " "+Var+" "

Like:- "'"+Var

Check your problems solve dor not 

2023-10-16 05-50-48
Shingo Lam

Hi @Aaron Kasab ,

I think in the csv file, the column that you want to set as text, should add the ' add the beginning of the data cell

Hope this help

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.