Extracting Data From A Tab Delimited String
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Extracting Data From A Tab Delimited String
I have a string that is separated by tabs. Is there any way to extract the data between tabs? I can't use the word command as there are spaces in my data.
example:
tHilitedText Contains...
name <tab> address 1 <tab> address 2
When I try the following, it only selects data up until a space is reached. I want to select until the tab is reached.
put word 1 of tHilitedText into tName
put word 2 of tHilitedText into tAddress1
put word 3 of tHilitedText into tAddress2
Thanks!
Warren
example:
tHilitedText Contains...
name <tab> address 1 <tab> address 2
When I try the following, it only selects data up until a space is reached. I want to select until the tab is reached.
put word 1 of tHilitedText into tName
put word 2 of tHilitedText into tAddress1
put word 3 of tHilitedText into tAddress2
Thanks!
Warren
Code: Select all
set the itemDelimiter to tab
put item 1 of tHilitedText into tName
put item 2 of tHilitedText into tAddress1
put item 3 of tHilitedText into tAddress2
You can "set the itemDelimiter to" very many things, to make your own separators.
Also here http://support.runrev.com/scriptingconferences/ you will find some useful info, topic 8 and 16 deal with manipulating text.
Awesome! I was looking to do the same thing today. Thanks!
SparkOut wrote:should do the trickCode: Select all
set the itemDelimiter to tab put item 1 of tHilitedText into tName put item 2 of tHilitedText into tAddress1 put item 3 of tHilitedText into tAddress2
You can "set the itemDelimiter to" very many things, to make your own separators.