Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

I cannot import txt in numbers with column tab

Hi,

I have a plane txt file with two columns delimited with a simple tab. Once I open with Numbers it creates only one column and I do not manage to get two columns out of it.

I already tried to copy first in Pages and save as plane txt, I already tried to increase the space between the column.


Is everybody know if there is an official way to do it like in Excel?

Posted on Oct 2, 2015 11:51 AM

Reply
15 replies

Oct 2, 2015 1:06 PM in response to martarov

A plain text file that uses a tab for the delimiter will open in Numbers as multiple columns. Are you right clicking on the file and opening with Numbers? Does it have a txt extension so Numbers knows it is a text file? Are you sure it is a tab, not a bunch of spaces? It does work as you expect it to so something else must be going on (or I have misunderstood what you are doing or want to do).

Oct 2, 2015 2:37 PM in response to martarov

I looked at the file and it is a rich text file. It is NOT tab delimited. Like Badunit suggested the fields are separated by many spaces:


Here is how the file looks in Text Edit:

User uploaded file

Here is how it looks in a hex editor (called 0xED):

User uploaded file

Notice the highlighted green is the space between two fields. The text "20" is hexadecimal for a space character. A tab would be "09"


suggestion how to go make this work will require you to provide you work flow AND how often you do this. If it is very often that would beg for a solution that is convenient but may take some work up front. If this is a one time operation then there others.


If you double click the file it should open in Text edit.


hold the option key while the cursor is over the text window, the cursor should change to a cross hair. Now drag from the top left corner to the bottom right corner of the first column, as shown, copy. Now switch over to Numbers and paste into the first column:

User uploaded file


Now select the second column using the same technique:

User uploaded file

Oct 2, 2015 2:55 PM in response to Wayne Contello

I looked at the file and it is a rich text file. It is NOT tab delimited. Like Badunit suggested the fields are separated by many spaces:


Here is how the file looks in Text Edit:

User uploaded file

Here is how it looks in a hex editor (called 0xED):

User uploaded file

Notice the highlighted green is the space between two fields. The text "20" is hexadecimal for a space character. A tab would be "09"


suggestion how to go make this work will require you to provide you work flow AND how often you do this. If it is very often that would beg for a solution that is convenient but may take some work up front. If this is a one time operation then there others.


If you double click the file it should open in Text edit.


hold the option key while the cursor is over the text window, the cursor should change to a cross hair. Now drag from the top left corner to the bottom right corner of the first column, as shown, copy. Now switch over to Numbers and paste into the first column:

User uploaded file


Now select the second column using the same technique:

User uploaded file


If you have to do this very often then I would say a better method is in order. For a better solution we would need to know the regularity of the column widths



Here is one way that allows you to copy the data out of the text file and paste it into the first column of a Numbers table, then the columnized data appears in later columns:


User uploaded file

paste the data in column A


enter the values in row 1 columns B thru H as shown. Pasted here for convenience:

25

11

15

14

14

14

15


I1=LEFT(A1, B$1)


this is shorthand for select cell I1 (thet's the letter "I" 1 (the number one), then type, or copy and paste from here, the formula:

=LEFT(A1, B$1)


J1=MID($A1, 1+SUM($B$1:B$1), C$1)


select J1, copy

select J1 thru O1, paste


select I1 thru O1, copy select columns I thru O, paste



Paste the contents of the text file into column A

Oct 2, 2015 3:22 PM in response to Badunit

yes of course I'm doing with right click and open with numebers. 🙂 Yes it's for sure a plane text and I actually create the file so I can put a tab or a space or whatever I want and I am pretty sure I tried all. but I'll try with a single tab again just to be sure I didn't mix it up.

possible this file as a problem but due to the fact I find myself doing this import quite some times for work I wonder if there was a more practical way to do it because paste it in pages and exporting again and then opening with numbers it's pretty stupid and not practical at all.

Oct 3, 2015 5:22 AM in response to martarov

Is that what you ended up doing? Numbers will import a tab-delimited file as columns and rows without having to go through Pages. Is there a way to get whatever software is generating your incorrectly formatted text file to format it correctly from the start? Or, if you want, send me one of these files and I'll take a look at it and see what I would do instead.

Oct 3, 2015 6:01 AM in response to Badunit

No wait wait wait! For this specific file I did not do because I create so I just add a \t in my code and it worked.

But I had other files coming from a program so where I could not put a tab to delimit but there was only a space and I had to copy in Pages first and so on and so for...I could send you but does not make too much of a sense if a standard approach for import does not exist, next time with another file I will have another problem...

I cannot import txt in numbers with column tab

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