Split string into objects


I use a serialport Node to receive ascii messages from an rs232 power inverter.
Everything works fine and I got informations in one payload string:

00.00.0000 01:21:40   3 124.9  0.23    29 236.2  0.12    28  23

Now I want to seperate each value into one payload object. Like payload.voltage, payload.power etc

My js knowledge is limited and I absolutely have no idea how to split this string.

I appreciate your help,

And you already entered "split" into the forum search and nothing came up...

1 Like

Yes, i googled a lot. But the values are not separated by commas to tabs but spaces of Individual length.

This should provide the answer


Awesome, I will give \s+/ a try
Thank you!