Any 'clever' way to get the `linecount` of a CSV f...
# suitescript
d
Any 'clever' way to get the
linecount
of a CSV file? I must simply 'iterate' it with the iterator and count myself?
k
would
csv.split('\n').length
work?
assuming you can get csv into a string
s
if feeling clever try and see if the
File.lines
property has any juicy info on it. The only thing documented is the
iterator()
but maybe there's more secret sauce?
d
I like your thinking @stalbert
Nope .. empty object
b
The point of those streaming methods is to only load a portion of the file at a time
you cant tell how many lines a csv file has without reading the entire file
c
Are you trying to make sure you aren't uploading more than the allowed CSV amount?
d
I'm exporting the csv's and was getting as much meta data as I could. Some of the API's need your SSN just to authenticate!
Looks like I don't need the line count as it turns out
c
thats crazy. I've never seen an API that requried that
d
They wanted my first child too! That was an easy decision
(Not sure if my jokes translate very well in slack)
success kid 4