Using Tab as delimeter

I’d like to use the Tab character to split up a string with the String.Split node
How to I pass in a Tab?
I tried a Code Block with chr(9); but Dynamo doesn’t accept that.

I guess I need a CR/LF, too.
Using FileSystem.ReadText doesn’t return a list of strings. It’s just one big long string

saw a post somewhere that gave the /n for a line break in a multi-line text
in this post were some examples of / command options
sadly /d is a search term too short for searching in the database

How are you receiving the data? If it’s a .tsv file you could use the csv module in python, specifying the tab character as your delimiter.

import sys
sys.path.append(r'C:\Program Files (x86)\IronPython 2.7\Lib')
sys.path.append(r'C:\Program Files\IronPython 2.7\Lib')
import csv
import StringIO

file_in = IN[0]
output = []
source = StringIO.StringIO(file_in)
file_read = csv.reader(source, delimiter='\t')
OUT = [line for line in file_read]

1 Like

/n does something really weird and /t doesn’t do anything, same result with forward or backslashes

This is actually a Text file I’m writing from a DWG using LISP
It just seems like it shouldn’t be this hard to simply get a Tab character - or any special character - into Dynamo

With enough hints, I finally got something to work!