Google sheet when saved as csv data file cannot be read correctly in POSTMAN

I have a google sheet with data as below:

image

I downloaded this sheet as .csv file and imported in Postman, on preview I see the zero’s removed although the field in data file is plain text

I have attached the google sheet link for reference:
https://docs.google.com/spreadsheets/d/1FtunobmzbsvSkU_UGb7qxKiU0r0rL4NzcMX3bVok4h4/edit?usp=sharing

@danny-dainton could you pls have a look on this

I am pretty sure Postman is assuming the column is a number, therefore removing the leading 0’s.

You could edit the csv and surround the numbers in quotes to work around this.

Hello,
I found this comment that describes how Postman converts a number in a csv to a Javascript number, and that’s why for a number 000000000003060638 it converts to 3060638. The workaround suggested in the comment is also to add quotes.

There’s also a feature request for more control over CSV parsing.

1 Like

Hi @allenheltondev
I already tried the usage of quotes, but it didn’t give the expected result. Let me share what I got :slightly_smiling_face:

  1. By using only single quotes to the value as below
    image
    POSTMAN preview was:

  2. By using only a single quote infront of the value as below:
    image
    POSTMAN preview was:

  3. By using double quotes to the value as below:
    image
    POSTMAN preview was:

None of the above gave the correct value what I wanted.

My expected output is:

Hey @jency.stella19,
I tried substituting with quotes directly in the csv. And it works in the expected manner.

I am not able to attach the csv here, but this is how the csv looks:

Your example only has the single quote at the end of the value. That might be your issue.

It seems like @meenakshi.dhanani was able to get it working though.

@allenheltondev I have shared all possible combinations of the values but none worked :roll_eyes:

@meenakshi.dhanani The issue is with ‘google sheet’ not ‘csv file’ to be clear on my question raised, when a sheet is downloaded to csv format and imported in postman I get the above error.

Try editing the csv in a program that is not excel. I used notepad and added quotes around the number and Postman treated it appropriately.

image

2 Likes

have you tried adding a single leading single-quote to the data? That at least seems to work on displaying the numbers fully within the Sheets app… (updated) and then if I save as csv, and open in notepad I can see the leading 0’s and there’s no single-quote included for formatting…

This worked @allenheltondev thanks for the trick here