Removing text from a string

I have an OBJ file which I would like to import into Revit using Dynamo. I only want the coordinates from the file. I want to remove the title, and only keep all the values starting with “v”. The “v” values are the cordinates so I only want to extract these values from the file & create a list showing the points. Once I have obtained the points I can go from there.
I have looked on the forum pages but I cant seem to find where you can remove “lines of text” & not just remove or replace a single character.

Thanks in advance.Dynamo_OBJ_Test.dyn (27.4 KB)

I have had to add the OBJ asa text file so you can view whats inside the file but I am unable to upload the actual OBJ file.Dynamo_Obj_Test.txt (2.9 KB)

Hi @andy.payton

I would suggest you save txt file in to xlsx and convert to points.

image

And here is the excel file Obj_Test.xlsx (11.2 KB)

1 Like

Thank you for your quick response & answer, The file is originally an .obj file which has been exported from ReCap, I wanted to avoid the extra step of using Excel as I wanted to create directly from what the .obj file generates.
I still don’t know how to replace/remove the text in the string from the file as i only need the “v” values, not the “vn” or “vt”.

Just read from the text file (you can even use Dynamo to convert the .obj to .txt) and search for String.StartsWith "v " instead of just “v”.

1 Like

ObjToNumber.dyn (8.4 KB)

2 Likes

An alternative using regular expressions:

2 Likes

Thanks everyone, you have been a great help!

1 Like