04-24-2024 03:04 AM
Hi everyone, I'm very new to a LabVIEW program and I'm trying to learn about it but seemingly I'm currently struggling to extract and sort the string data into the array. Ultimately, I'd like to be able to extract and sort the data and covert into a numeric array to do a further analysis. Do anyone have any suggestions on this issues?
Regards.
04-24-2024 03:43 AM - edited 04-24-2024 03:47 AM
Hi libra,
@librathedrowsy wrote:
I'm currently struggling to extract and sort the string data into the array. Ultimately, I'd like to be able to extract and sort the data and covert into a numeric array to do a further analysis. Do anyone have any suggestions on this issues?
What have you tried and where are you stuck?
You have a structured text file and need to parse its content.
Fortunately its structured very simple like:
[1.1.1.1.1 - Trace Data]
Sweep Data(mV)<1000>=-19.8100,21.3733,…,0.3650,0.3133/
0.3117,0.2517,…,0.1133,0.1133/
0.1083,0.1117,…,0.0667,0.0667/
…
-0.0183,-0.0117,-0.0083,-0.0167,-0.0183
I would:
The file content looks very similar to an INI file, so you could even try to use the ConfigFile functions on your file.
Just tried that on my own and it failed. Stick with string functions instead…
04-24-2024 03:50 AM
@GerdW wrote:
tent looks very similar to an INI file, so you could even try to use the ConfigFile functions on your file.Just tried that on my own and it failed. Stick with string functions instead…
Probably because multibyte chars inside. Quick and dirty something like that should work:
04-24-2024 03:54 AM - edited 04-24-2024 03:58 AM
What are you struggling with specifically?
Since your file is encoded in UTF16, you need the NI Unicode Tools (vipm, forum post) to convert it to ASCII text.
Then you can use the config file VIs to read keys.
You have to read arrays as strings and convert them using spreadsheet string to array.
Edit: Ok, arrays split across lines are not recognized, so unfortunately the config file VIs are out.
04-24-2024 04:38 AM
Hi,
maybe the OP just edited/saved the attached text file using Windows notepad, which is often converting plain ASCII text files into UTF-encoded text files.
I would guess the original software ("Synergy v.12.2") writes simple ASCII text files…
So before converting Unicode to ASCII I would ask the OP for clarification on this topic!