Git Product home page Git Product logo

Comments (8)

stalsma avatar stalsma commented on July 21, 2024

I encountered the same issue. I have some Amazon product IDs that start with a 0. Even if they are non-integer values (e.g. 087483774X), they seem to be interpreted as integers.

from mr-data-converter.

thdoan avatar thdoan commented on July 21, 2024

FYI I fixed this issue in my fork. Here's the fix:

isNumber: function(string) {
  return (!(string==='' || isNaN(+string) || /^0\d+/.test(string)));
},

from mr-data-converter.

CodeAbuser avatar CodeAbuser commented on July 21, 2024

@thdoan I tried your version and I have some data that has a value of 0 and it's not wrapping the 0 with quotes for me.

from mr-data-converter.

thdoan avatar thdoan commented on July 21, 2024

@CodeAbuser can you give me sample data that shows the issue by submitting a new issue in my fork? Thanks.

from mr-data-converter.

stalsma avatar stalsma commented on July 21, 2024

Thought I would chime in on this. I used your build, and it fixed a ton of
issues that I was having to clean up regular expressions after the
conversion. But it create a new one.

Some of my data is optional (that is empty) in excel. Where I was
previously getting null in the json, now I am getting a empty string
(""). Not sure what the expected behavior should be.

On Tue, Apr 5, 2016 at 9:21 PM, Tom Doan [email protected] wrote:

@CodeAbuser https://github.com/CodeAbuser can you give me sample data
that shows the issue please?


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#32 (comment)

from mr-data-converter.

thdoan avatar thdoan commented on July 21, 2024

@stalsma can you provide a small data sample I can test with and what to expect? I haven't touched the code in awhile, but from my recollection whether it returns null or "" depends on the existing data in the column. For example, if the column contains strings or a mix of strings and numbers, then an empty cell would output an empty string; if a column contains only numbers, then an empty cell would output null. I may add an option to force it to "" or null if that's helpful.

Also, please report bugs/feature requests in my fork. Thanks.

from mr-data-converter.

stalsma avatar stalsma commented on July 21, 2024

@thdoan Here is the raw input (corresponding Excel attached--b/c the formatting w/the tabs will get lost).

id ebookISBN hardcoverISBN paperbackISBN cdISBN
737 978-1-939160-80-5 978-1-939160-73-7

Both the hardcover and cd ISBNs are converted to empty strings instead of nulls.

[{"id":737,"ebookISBN":"978-1-939160-80-5","hardcoverISBN":"","paperbackISBN":"978-1-939160-73-7","cdISBN":""}]

I agree that this is a preference sort of thing, and "" could be a correct interpretation of the data (as is null).

BTW, I tried attaching directly to your fork, but there wasn't an issues tab....

mrdataConvertor sample.xlsx

from mr-data-converter.

thdoan avatar thdoan commented on July 21, 2024

@stalsma I have reverted the tool to set null value instead of empty string for empty cells in int/float columns.

from mr-data-converter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.