02-19-2024 08:16 AM
Hi, I am trying to filter 'string in' so the information will be separated into a table (1D array). So in this string MESSAGE will be in its own column, time will be in its own, date as well and then the rest of the information in the final column.
Does anyone know how to do this ?
Kind regards
Hraym
Solved! Go to Solution.
02-19-2024 08:20 AM - edited 02-19-2024 08:26 AM
Hi hraym,
@hraym2004 wrote:
Hi, I am trying to filter 'string in' so the information will be separated into a table (1D array). So in this string MESSAGE will be in its own column, time will be in its own, date as well and then the rest of the information in the final column.
You can use SpreadsheetStringToArray to separate the substrings by the Tab delimiter.
When time and date should be located in their own columns then you need to split them at the SPACE delimiter…
You can also hard-code your requirement:
02-19-2024 08:24 AM
Thank you for the response,
Would you be able to make the code yourself and show me. I am still new to Labview so still trying to wrap my head round certain stuff.
Kind regards,
Hraym
02-19-2024 09:47 AM - edited 02-19-2024 09:57 AM
Let's assume that your string display is set to \-codes. Is it?
What are the fields you want? Are the delimiters all tabs or is there a mix of tabs and spaces?
Typically :"spreadsheet string to array" might do what you want. <tab> is the default delimiter.
02-22-2024 03:16 AM
Morning,
I have tried to do this myself now but keep getting stuck.
I need to filter all the text files from the folder into a table where the data is split up. So Status/Message in first column, date and time in second, then any further information in the third column.
I need a row in the table for each line in the text file.
The end goal is to use the time and dates to work out the elapsed time that this machine was running for each day so I will have to change the date and time into Labview times as well and do the calculation.
Does anyone know how to code a program to achieve this ?
Kind regards,
Hraym
02-22-2024 03:22 AM - edited 02-22-2024 03:23 AM
Sorry I did not realise the text files were not attached.
Please find attached 2 text files. There is more than these 2, but these will be enough to give you an idea of how they are formatted
Kind regards,
Hraym
02-22-2024 04:09 AM
In general something like this should work for your particular data, because they already tab-delimited: