12-08-2018 11:23 PM
hey,
I want to split the input string after every special character ($) coming from com port and want to save it in a 2D array, then I want to retrieve the splitted string in its orignal form from array and send it to com port ...
Can anyone help ???
Thanks in advance
12-09-2018 12:00 AM
Spreadsheet String to Array and use $ as the delimiter.
Reverse is Array to Spreadsheet String
12-09-2018 01:26 AM
12-09-2018 09:07 AM
@atul_ghumade wrote:
Here's sample code I made for you. Let me know if that helps.
I don't think atul_ghumade's code will work as-is. The last For Loop to recreate the original data is flawed. It assumes that the com data has only two columns, so you may lose data. ex. a string of "1$2$3$4$5" will truncate to only "1$2". Also, the tunnel mode of the loop is set up as Indexing, so the output would be a 1D array.
Use RavensFan's recommendation and use Array to Spreadsheet String for the reverse process.
12-09-2018 10:02 AM
12-10-2018 05:32 AM
Might as well (or slightly better actually) make that a 1D array. Right click the 2D array constant and select "Remove Dimension".
Also remember that the Array to Spreadsheet String always adds a \n to the end. You might want to remove that before sending.