12-16-2019 10:05 AM
Hello everyone I am new to this community.
I have 1d array of string which i have taken from a CSV file, the array is quiet big its like 1800 parameters in it. I am looking for a technique to extract specific data from each string parameter. for example SLR_D12_RC2_VS7.0_VL6.6_SL1 is one parameter and i would like to extract RC, VS7.0, VL6.6, SL1 from it. Similarly LIN_T_RX_PDF_14V_SL2 is another parameter and i want to extract PDF, 14V, SL2 from it. There are many more parameters like these and the values that i need are separated by _ (underscore).
How would it be possible.
Thank you in advance.
12-16-2019 10:36 AM
Do a scan from string with %s_%s_%s .... or a Spreadsheet string to array where the underscore is your delimiter character.
12-16-2019 10:38 AM
Hi shahabkhan,
use SpreadsheetStringToArray on each of those strings, using the underscore as separator char, to parse each string into an array of strings. Now you can use IndexArray to read the substrings of interest…
@Pukhtun_Yum wrote:
SLR_D12_RC2_VS7.0_VL6.6_SL1 is one parameter and i would like to extract RC, VS7.0, VL6.6, SL1 from it. LIN_T_RX_PDF_14V_SL2 is another parameter and i want to extract PDF, 14V, SL2 from it.
The first example reads substrings starting with index 2 (3rd element), the second example reads substrings starting with 4th substring element. Maybe there is some additional rule to determine the substrings of interest?
12-16-2019 02:17 PM
Try the suggestions and if you cannot figure it out post your code with the CSV file and we can give more suggestions.
12-18-2019 06:46 AM
@RavensFan wrote:
Do a scan from string with %s_%s_%s ....
Scan From String won't work that way.
A "_" is a string, so it will (try to) parse the entire input as part of the first string.
Scan From String will only work with "%[^_]_%[^_]_%s", specifying: characters not in set, match exact string, characters not in set, match exact string, string...