Hi guys,
I'm sure this should be an easy one for you, although I couldn't find an example in some searches on the forum.
I have a csv file (from a shopping cart export) I've split up and read into an array holding these values as strings. What I want to do now is test some of them to see if its a number string (product prices) or just text (product descriptions). The reason why I need to test for them is that the csv has a varying number of product description fields, depending on the number of additional product options it has, before the price is given in the csv file.
So I want to search the successive string array elements, starting at the first product description field, until I find the price field (number to 2 decimal places) and then I'll know where I am for the rest of the structure of the CSV, which doesn't vary after that.
I couldn't find a specific string function to do this, I'm thinking there must be some simple type testing available, or is it the fact that I've stored it as a string meant that I need to do some sort of manual test, charatcer by character?
Thanks for your help and advise.
Philip.
I'm sure this should be an easy one for you, although I couldn't find an example in some searches on the forum.
I have a csv file (from a shopping cart export) I've split up and read into an array holding these values as strings. What I want to do now is test some of them to see if its a number string (product prices) or just text (product descriptions). The reason why I need to test for them is that the csv has a varying number of product description fields, depending on the number of additional product options it has, before the price is given in the csv file.
So I want to search the successive string array elements, starting at the first product description field, until I find the price field (number to 2 decimal places) and then I'll know where I am for the rest of the structure of the CSV, which doesn't vary after that.
I couldn't find a specific string function to do this, I'm thinking there must be some simple type testing available, or is it the fact that I've stored it as a string meant that I need to do some sort of manual test, charatcer by character?
Thanks for your help and advise.
Philip.