Read .txt and convert in a list of number

Hello everyone!

I would like to transform a list of numbers (strings), read from a txt file, into a list of values ​​(numbers) to be inserted as extrusion distances.
How can i do?

thank you!

String.ToNumber node might help.

1 Like

thank you.
i’ve tried but doesn’t work with the list.
one string to one number works but list of strings to list of numbers doesn’t.
i’m new with dynamo, maybe i make some mistakes.
can you show me an example?

You don’t have a list yet - you have a single string with all the numbers in it. What single number is this (remember you only get to pick one number):

1
2
3

Doesn’t make sense right? You have to tell Dynamo where the strings split between each number.

Use a String.Split node with a new line character (string node and hit return once as the input) to split the values by line. Then use a String.ToNumber node to convert the data type.

thank you both!
it works!