09-29-2014 02:07 AM
Hello All,
I want some help. Please help me.
I have comma delimited Data. When I’m converting Sting to Array, If two commas exists in between then its displaying “Zero” (because its array propriety ). Instead of that I want to display “NaN” .
Please give me any idea to replace comma to NaN. I tried with Search and Replace but it’s not giving as I expected.
Solved! Go to Solution.
09-29-2014 02:18 AM - edited 09-29-2014 02:21 AM
09-29-2014 02:55 AM
Thanks for your reply.
Please check this snippet. Here, at end of the string, I have two commas so we will get 10,NaN,20,……. 12,NaN. But I don’t know why zero is adding to array (last element) If end of the String having only commas.
09-29-2014 02:58 AM - edited 09-29-2014 02:59 AM
Hi Munna,
you really need to explain your requirements better in the first step…
Those two last comma are converted to ",NaN,". SpreadsheetstringToArray converts this to ",NaN,Zero" because you have set the comma as separator char and this function expects a valid entry after the last comma. If you don't like this behaviour you need to delete the last comma, when it is the last char of the string!
09-29-2014 03:16 AM
Hello GerdW,
Thanks for your reply & Sorry for the inconvenience.
As per my data file, If end of the String comma exists I need to display “NaN”. (it means 12, NaN, NaN)
09-29-2014 03:18 AM - edited 09-29-2014 03:19 AM
09-29-2014 03:27 AM
Hi GerdW,
I want to display NaN if Data is not present after the Comma.
Example:
09-29-2014 03:34 AM
09-29-2014 04:24 AM - edited 09-29-2014 04:27 AM
Hello GerdW,
Thanks you so much for your reply.
I thought, instead of replacing trailing comma by NaN adding comma before string is more better (because to many string manipulations) But, it’s taking more execution time.
09-29-2014 04:28 AM