Using string manipulation node to extract a single string variable

81 Views Asked by At

hi im new to knime and im having some trouble using the string manipulation node. instructions This is the set of instructions I was given and im not sure how to extract the 3 letter code. airport code Here's a screenshot of the airport code im working with. How would I go about extracting the 3 letter code from each row?

i've tried watching youtube tutorials but im still not quite sure. I keep getting the warning (Invalid settings: Ambiguous return type! Use 'string()' or another function from the "Convert Type" category to specify the return type.

2

There are 2 best solutions below

0
JohnTdata On

Try the CSV Reader node - it should read in your file and split out the three columns which are separated by commas. The first field should then show you the airport codes. You can also use the Cell Splitter with a comma (,) delimiter to split out a single field into multiples. But start with the CSV reader node to open your original file.

0
Tema Torg On

If you want to use exactly the "String manipulation" node instead of the "CSV Reader" node:

substr($Code$, 0, 3)

where $Code$ is your column with data

node settings picture