Import .txt file into Numbers

Hello, I am a new Mac user and I am trying to get more familiar with Numbers within iWork. How can I import a .txt file into Numbers where it will display each data into its own cell? The data within the txt file are all separated by commas. Currently, when I simply drag the txt file into a blank numbers spreadsheet, it shows the data but no in its own cell. Thanks in advance for those willing to take the time to help me!

Mac OS X (10.5.7)

Posted on May 25, 2009 5:41 PM

Reply
2 replies

May 26, 2009 6:52 AM in response to Tiggertime

Even if the file is given the correct extension name, dragging the file's icon on an open table will give the described behavior.

To grab infos from a csv file we must open it with Numbers.

We may also use an alternate path:

open the csv file in TextEdit
select all
copy

run this script:


if character 2 of (0.5 as text) is "," then
set delim to ";"
else
set delim to ","
end if
set entexte to the clipboard as text
set entexte to my remplace(entexte, delim, tab)
set the clipboard to entexte
on remplace(t, d1, d2)
local l
set AppleScript's text item delimiters to d1
set l to text items of t
set AppleScript's text item delimiters to d2
set t to l as text
set AppleScript's text item delimiters to ""
return t
end remplace


paste where we want.

Only tab separated values (tsv) files may be dragged & dropped in separated cells.
Only tab separated values (tsv) may be pasted in separated cells.

Yvan KOENIG (from FRANCE mardi 26 mai 2009 15:48:34)

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Import .txt file into Numbers

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.