04-29-2016 08:16 PM
Hi. I am trying to do serial communication with a machine which send data for the given command. When command "d" is given i get response like
eg1. "d 1015 49.3 14.3 75.8 84.8 73.2 74.7 70.5"
eg2. "d 720 47.6 12.9 108 110 113 101 107"
eg3. "d 700 45.0 7.4 105 105 108 101 108"
eg4. "d 1177 48.1 8.2 6.5 5.0 5.8 11.7 3.5"
The space between each data is varying. So, how to seperate these values and put it into table?
Thank you.
04-29-2016 08:49 PM - edited 04-29-2016 08:49 PM
Use the Search and Replace String function. Set the flag to use Regular Expressions. You can then set it up to replace multiple spaces with a single space. Then use Spreadsheet String To Array with a space set to the delimiter to make your array.
04-30-2016 02:11 PM
Thank you crossrulz. This is very helpful. But sometimes second data after command will not be displayed,instead it shows blank space. This happens before machine stabilizes. In this time when i collected the data i got
" d 100 35.1 139 118 135 153 148"
"d 100 35.6 134 114 132 150 141"
"d 100 35.7 132 113 130 148 138"
After the machines stabilized i got these values
"d 200 4.6 7.9 85.6 84.8 85.0 90.4 82.5"
"d 200 4.4 7.4 86.1 86.6 85.0 90.1 82.7"
"d 200 4.4 7.9 84.8 83.1 84.2 89.9 82.0"
So how to put zero in array for the data which i have not received. Should we compare number of blank spaces or is there any other logic ?
05-01-2016 12:23 PM
How many fields (columns) are you expecting? Is it a set number, or does that change with time too? When an input is "stable" how many spaces are in between each? If it's not constant between each column, is it at least constistent, eg 1 space between first and second column, 3 spaces between second and third column, etc?