Text Delimiter not recognized when parsing data file

Hi All!
I’m trying to parse data into Grasshopper and have had some success with the read file component. Unfortunately, the whitespace delimiters are not recognized, so the data is partitioned inconsistently.

An attempt was made to break the information apart by fragment length, but each line may not have the same number of characters in each field, so this approach doesn’t work well and produces errors.

What would be a way to modify the parser to read the space between fields? What is an alternate method to separate the information?

Attached is a definition and one of the .txt original files being worked with.

Any help or thoughts would be greatly appreciated, thank you. MCB

4-11A-a.txt (5.5 KB)
PSS Data extraction test.gh (22.7 KB)

Hi Martin,

You have a tab-delimited data file to input but getting tab characters into Grasshopper to split it is not easy - hex values and escapes don’t work.

The trick is to type a tab into an empty panel wired up to a character input. You can leave it like that or internalize it into the character. I’d leave the apparently empty panel there with a note explaining what it is.

PSS Data extraction tab trick.gh (12.0 KB)

HTH
Jeremy

1 Like

Hi Jeremy, IDH!
Figuring out the tab delimiter brought many things into focus. Thank you for the elegant solution.

The most recent version from here has {tab} in a panel with Special Codes turned on and was going to be the source of a follow-up question… Where is the rest of the data in the list - not just the first entry?

Your definition breaks it out much more cleanly and is appreciated.

Attached is a definition that has two workable solutions for completeness but requires copying and pasting data into excel and saving it in a .csv format; external work that doesn’t make sense for large cases.

Jeremy, thank you again!!!
MCB

PSS Data extraction test v3.gh (27.2 KB)