I have a script which reads CSV file, one column i...
# suitescript
d
I have a script which reads CSV file, one column is a city, whose value is "Randolph, VT" when I split by comma in the script while reading columns index value changes because of "Randolph, VT" city name separated by a comma. how to fix this?
b
use something like papaparse (https://www.npmjs.com/package/papaparse)
correctly parsing csv is a pain
d
can i make use of this thirdparty library file MR script?
b
yes
d
thanks @battk i will make use of this, but still is there any other option to fix this
b
doing the work correctly requires implementing a parser
you are better off using a popular csv module
i personally like papa parse since it is isomorphic and works in node and browser
✔️ 1
those types of modules have the best chances of working in netsuite
💯 1
d
@battk if possible can you share me any sample script which u have tried using this?
b
what have you tried?
d
I tried stack overflow answer as of now for an immediate fix, thought to try papaparse now
b
its rather simple
d
@battk Thanks a lot, this library file is awesome.
@battk any other library files other than moment loadash and papaparse which is useful in NS
b
I tend to emphasize moment timezone over the normal moment
👍 1
I use moment when working with dates and strings
👍 1
Timezones are important for that
Ive also used handlebars for string templates
👍 1
Crypto-js if you have an unfortunate task that requires crypto
👍 1