Extract number from a string

I want to get a folder's size using the du command in exec node.
The expanded debug output is:

18019844	/mnt/8tb2/sia

The collapsed debug output is:

18019844->/mnt/8tb2/sia

I've tried a function node with:

msg.payload = msg.payload.split("/mnt")[0];

But it returns the number with the arrow:

18019844->

I'm not sure what the arrow between the number and path means, i'm guessing tab but don't know how to include it in msg.payload.split to correctly format the number.

In a function node...

msg.payload = parseInt(msg.payload);
return msg;
1 Like

perfect, thanks.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.