Getting from tab-delimited file to table

Let’s say I have a tab-delimited file, and the contents are:

Harry Jones Springfield
Fred Smith Boston
John Leary Springfield

I want to read this file and stick the contents in a table with the columns firstName:, lastName:, city:

I know how to create datasources and tables, but I can’t figure out how to get the data from the file into the right format so I can use the “append” command. The way I do it now is with a loop to set the values of each field - but it’s way to slow.
ie:
repeat with i in theList
set rowOne to make new data row at the end of data rows of filenameDatasource
set contents of data cell “First Name” of rowOne to firstName
set contents of data cell “Last Name” of rowOne to lastName
set contents of data cell “City” of rowOne to theCity
end repeat

Can anyone help?

I believe you need to use a list of lists so, try this:

set the_data to paragraphs of (read file the_file)
--which should result in something like (the spaces are tabs):
--{"Harry    Jones    Springfield", "Fred    Smith    Boston", "John    Leary    Springfield"}
set old_delim to AppleScript's text item delimiters
set AppleScript's text item delimiters to {tab}
repeat with i from 1 to (count the_data)
	set (item i of the_data) to (text items of (item i of the_data))
end repeat
set AppleScript's text item delimiters to old_delim
--{{"Harry", "Jones", "Springfield"}, {"Fred", "Smith", "Boston"}, {"John", "Leary", "Springfield"}}
--now append your data source with the_data

Jon

Awesome!! Thanks Jonn…