Importing .txt into numbers causes extra unwanted rows solution?

I have a text document that imports into numbers like this:
Name Age Eyes Likes
A B C D
1 Jack 4 Brown Cartoons
2 Playing
3 Laughing
4 Jill 7 Blue Dancing
as you can see, Playing and Laughing are in separate rows. what can i do to the .txt file to make my numbers spreadsheet look like this:
Name Age Eyes Likes
A B C D
1 Jack 4 Brown Cartoons, Playing, Laughing
2 Jill 7 Blue Dancing
thanks in advance.

Run this cript:
--=====
property nb : 3 (* count of fields in a record *)
property liste : {}
--=====
on run
set theFile to choose file "Select the text file" of type {"public.plain-text"}
my nettoie()
set tt to (read theFile)
set tt to my remplace(tt, quote, "")
set tt to my remplace(tt, "; ", "")
set tt to paragraphs of tt
set nbFields to count of tt
set nbRows to nbFields div nb
if (nbRows * nb) < nbFields then set nbRows to nbRows + 1
repeat with i from 1 to nbRows
set itm to item (1 + (i - 1) * nb) of tt
try
repeat with j from 2 to nb
set itm to itm & ", " & item (j + (i - 1) * nb) of tt
end repeat
end try
copy itm to end of my liste
end repeat
set tt to my recolle(my liste, return)
set the clipboard to tt
my nettoie()
end run
--=====
on nettoie()
set my liste to {}
end nettoie
--=====
on recolle(l, d)
local t
set AppleScript's text item delimiters to d
set t to l as text
set AppleScript's text item delimiters to ""
return t
end recolle
--=====
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
--=====
Then paste the clipboard in a table of Numbers.
Yvan KOENIG (from FRANCE mercredi 11 février 2009 21:12:32)

Similar Messages

  • Import data into Numbers from web?

    Is there a way to import data from the internet directly into Numbers without programming/writing an applescript or using a different program?
    Can you do this while using only Numbers and the web?

    And how is Numbers to know how to extract the exact data you want from an external source, unless that source is in a format familiar to Numbers, which HTML isn't? For an automated process like this, you will need scripting, and that means learning to program/understand scripts.
    For example, here's some HTML code from a web page that includes volume data for one symbol:
    <td class="mbi_left" align="left" width="35%">BM&FBOVESPA SA</td><td align="right" width="10%">12.37</td><td align="right" width="10%">0.22</td><td align="right" width="10%">1.81</td><td align="right" width="20%">11,611,700</td><td align="right" width="15%">09/18</td>
    Numbers can't interpret this without being told exactly what to extract. Also, Numbers doesn't go out to the web on its own at fixed intervals (as I suspect you may want) without a program telling it what to do. This is just a spreadsheet after all.

  • Importing Contacts into Numbers?

    Does anyone know why each time I drag a contact into numbers it creates a new Table for each contact. This adds lots of unnecessary additional columns, all redundant from the first import. Would like to just have each contact import onto the one page and into appropriate fields. I spoke to Apple about this and they seem to think it's either a bug or nobody has ever wanted to do this even though this option is detailed in the help info in numbers.

    You probably want to use the Feedback feature of Numbers (under the Numbers menu) to report this bug. Meanwhile, I can offer a work around. Discovering that each drag/drop resulted in a new table, I selected 2 contacts - they were placed in Numbers in a single table. So your work around is to create a group in Address Book and then select all the members of the group at once. This is feasible as long as you don't anticipate adding people to the sheet later.

  • Import CSV into Numbers under European Settings?

    SUMMARY: Anyone know how to import a CSV into Numbers on the iPhone when under European settings?
    DETAIL:
    The iPhone version of numbers seems to have difficulties reading any CSV if the user's device is on a setting where the decimal separator is a comma (e.g. 12,00) (such as most of Europe). Interestingly the iPad version does not have this problem.
    For example HelloWorld.csv containing
    Hello,World
    imports as all one line rather than in two columns.
    UTF8 of UTF16 doesn't seem to make a difference.
    Changing the comma to a tab doesn't make a difference. (Numbers won't import .tsv files either.)
    Adding quotes to the fields doesn't help.
    Suggestions on creating a file that Numbers can import?

    On the iPhone, go to Settings, then General, then International, then Region Format. Set that to whatever it is on the iPad and then the CSV file should import the same on iPhone as it does on iPad. Not sure what else it will change, but if you have it changed on your iPad already, maybe it won't be a problem for the iPhone. And you can always change it back after importing the file I guess. Good luck.

  • How to import .txt for catalog

    Is there a way to import .txt into InDesign like Pagemaker used to do?

    Personally, I would use data merge to get the data into ID. ID cannot, however, use a logic-based import for setting styles. There is a plug-in I use that would handle that part just fine.
    The data file has superfluous information in it. It has missing headers for those columns at the end, though I am uncertain that info is even used without scrolling through the ID file. The ads/info graphics (or whatever they are) would need to be placed individually. Not a big deal. The biggest challenge by not using data merge to get the data in is (1) cleaning that file up for a regular text import and, (2) manually formatting what I suppose is a larger file than was uploaded.
    I have done course catalogs for two colleges. One was XML, the other was a data merge. I frankly don't see the problem. The plug-in I use in QXP is available for ID as well. For ID it is InData by Em Software. It was well worth the cost. If you go this route, do download, install, and try it before plunking down the money. It takes "programming" to use it in that one creates what they call prototypes. It really is simply a bit of code. It isn't onerous to learn.
    Mike

  • How do I import a CSV file into numbers so the columns show

    Thanks for the help.  I have a CSV file generated by the Google Keyword tool; when I open it in numbers all the values go into the same row.  I get the correct number of rows but only one column with five values in each one.  I read on here to check and see if the extension is correct and it is csv.  I've also dragged the file onto the number icon in the dock and get the same result.  Google gives you the option of exporting as a tsv file. Did that and I got the exact same result.  I've looked at the CSV file in textedit and it doesn't show any commas, but seems to have tabs.  But the tsv file doesn't open correctly either.  I'm at a loss. 

    If the file is created as TSV one, its name extension must be .txt.
    Numbers open such files flawlessly.
    Yvan KOENIG (VALLAURIS, France) mardi 4 octobre 2011 11:53:27
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community

  • Import .txt (from Excel) into Address book not happening

    I am attempting to import a .txt file (exported from an Excel file) containing 5000 contacts with email and phone details. In the Import dialogue I can map the columns to the Address Book properties. When I press OK the button stays blue (highlighted) for a few seconds but no import occurs. Not even the card being previewed.
    What am I missing here? (Bit urgent too)

    I had the same problem. I saved as tab-delimited in excel, closed it but upon import, address book would hang (spinning wheel or no response). So, I reopened the .txt file in Numbers instead, got rid of any strange lines, saved again as .txt. Then, I imported it into Address book and it was fine.
    To see whether it had to do with Numbers or Excel, I reopened the .txt file in Excel also, did the editing out of strange lines/cells again, and imported into address book again without problems.
    Seems like a really dumb hack, but it worked for me. I had 62 entries (address book always stalled at 5).

  • Import txt file into report

    I have an Arinc signal that I have decoded into each of its digital I/Os.  Since I have over 150 I/Os I needed a way to sort and do a quick report on them.
    I have three categories.
    1. Stayed =1 throughout test
    2. Stayed = 0 throughout test
    3. Changed either from 0 --> 1 or 1-->0 during the test.
    I want to just put a list of the signals for each of these categories into my report.
    I have created a txt file for these to go in, but how do I import that into my report?
    Or is there an easier way?
    Here is an example of my code...
    'HCM1
    'HCM1 Label 104 decode - Untitled 3
    Call Calculate ("Ch(""HCM1_104/HCM_1_CAS_HSOV_A1_CLOSED"")= GetB (Ch(""[1]/Untitled 3""),0)")
    Call Calculate ("Ch(""HCM1_104/HCM_1_CAS_HSOV_A2_CLOSED"")= GetB (Ch(""[1]/Untitled 3""),1)")
    Call Calculate ("Ch(""HCM1_104/HCM_1_CAS_HPP_A_RUNNING"")= GetB (Ch(""[1]/Untitled 3""),2)")
    Call Calculate ("Ch(""HCM1_104/HCM_1_CAS_SYS_A_HI_TEMP"")= GetB (Ch(""[1]/Untitled 3""),4)")
    Call Calculate ("Ch(""HCM1_104/HCM_1_CAS_SYS_A_LO_PRS"")= GetB (Ch(""[1]/Untitled 3""),7)")
    Call Calculate ("Ch(""HCM1_104/HCM_1_CAS_HPP_A_LO_PRS"")= GetB (Ch(""[1]/Untitled 3""),12)")
    Call Calculate ("Ch(""HCM1_104/HCM_1_CAS_HPP_A_HI_TEMP"")= GetB (Ch(""[1]/Untitled 3""),13)")
    'HCM1 Label 105 decode - Untitled 4
    Call Calculate ("Ch(""HCM1_105/HCM_1_FLT_HSOV_A1_FAIL"")= GetB (Ch(""[1]/Untitled 4""),0)")
    Call Calculate ("Ch(""HCM1_105/HCM_1_FLT_HSOV_A2_FAIL"")= GetB (Ch(""[1]/Untitled 4""),1)")
    Call Calculate ("Ch(""HCM1_105/HCM_1_FLT_EDP_A1_FAIL"")= GetB (Ch(""[1]/Untitled 4""),2)")
    Call Calculate ("Ch(""HCM1_105/HCM_1_FLT_EDP_A2_FAIL"")= GetB (Ch(""[1]/Untitled 4""),3)")
    Call Calculate ("Ch(""HCM1_105/HCM_1_FLT_SYS_A_PRS_FLT_CLG"")= GetB (Ch(""[1]/Untitled 4""),6)")
    Call Calculate ("Ch(""HCM1_105/HCM_1_FLT_SYS_A_RET_FLT_CLG"")= GetB (Ch(""[1]/Untitled 4""),7)")
    Call Calculate ("Ch(""HCM1_105/HCM_1_FLT_EDP_A1_FLT_CLG"")= GetB (Ch(""[1]/Untitled 4""),8)")
    Call Calculate ("Ch(""HCM1_105/HCM_1_FLT_EDP_A2_FLT_CLG"")= GetB (Ch(""[1]/Untitled 4""),9)")
    Call Calculate ("Ch(""HCM1_105/HCM_1_FLT_HPP_A_LO_QTY"")= GetB (Ch(""[1]/Untitled 4""),11)")
    Call Calculate ("Ch(""HCM1_105/HCM_1_FLT_HPP_A_FAIL"")= GetB (Ch(""[1]/Untitled 4""),12)")
    Call Calculate ("Ch(""HCM1_105/HCM_1_FLT_HPP_A_CDF_FLT_CLG"")= GetB (Ch(""[1]/Untitled 4""),14)")
    Call Calculate ("Ch(""HCM1_105/HCM_1_FLT_IV_A_FAIL"")= GetB (Ch(""[1]/Untitled 4""),15)")
    Call Calculate ("Ch(""HCM1_105/HCM_1_FLT_IV_A_FAIL_LOCAL"")= GetB (Ch(""[1]/Untitled 4""),16)")
    'HCM1 Label 106 decode - Untitled 5
    Call Calculate ("Ch(""HCM1_106/HCM_1_FLT_SYS_A_PF_DPI_FAIL"")= GetB (Ch(""[1]/Untitled 5""),0)")
    Call Calculate ("Ch(""HCM1_106/HCM_1_FLT_SYS_A_RF_DPI_FAIL"")= GetB (Ch(""[1]/Untitled 5""),1)")
    Call Calculate ("Ch(""HCM1_106/HCM_1_FLT_EDP_A1_CDF_DPI_FAIL"")= GetB (Ch(""[1]/Untitled 5""),2)")
    Call Calculate ("Ch(""HCM1_106/HCM_1_FLT_EDP_A2_CDF_DPI_FAIL"")= GetB (Ch(""[1]/Untitled 5""),3)")
    Call Calculate ("Ch(""HCM1_106/HCM_1_FLT_EDP_A1_PS_FAIL"")= GetB (Ch(""[1]/Untitled 5""),4)")
    Call Calculate ("Ch(""HCM1_106/HCM_1_FLT_EDP_A2_PS_FAIL"")= GetB (Ch(""[1]/Untitled 5""),5)")
    Call Calculate ("Ch(""HCM1_106/HCM_1_FLT_SYS_A_PX_FAIL"")= GetB (Ch(""[1]/Untitled 5""),6)")
    Call Calculate ("Ch(""HCM1_106/HCM_1_FLT_SYS_A_TX_FAIL"")= GetB (Ch(""[1]/Untitled 5""),7)")
    Call Calculate ("Ch(""HCM1_106/HCM_1_FLT_SYS_A_QX_FAIL"")= GetB (Ch(""[1]/Untitled 5""),8)")
    Call Calculate ("Ch(""HCM1_106/HCM_1_HSOV_A1_IND_FAIL"")= GetB (Ch(""[1]/Untitled 5""),10)")
    Call Calculate ("Ch(""HCM1_106/HCM_1_HSOV_A2_IND_FAIL"")= GetB (Ch(""[1]/Untitled 5""),11)")
    Call Calculate ("Ch(""HCM1_106/HCM_1_EDP_A1_FAIL"")= GetB (Ch(""[1]/Untitled 5""),12)")
    Call Calculate ("Ch(""HCM1_106/HCM_1_EDP_A2_FAIL"")= GetB (Ch(""[1]/Untitled 5""),13)")
    Call Calculate ("Ch(""HCM1_106/HCM_1_FLT_FV_A_FAIL"")= GetB (Ch(""[1]/Untitled 5""),14)")
    Call Calculate ("Ch(""HCM1_106/HCM_1_HSOV_A1_RELAY_FAIL"")= GetB (Ch(""[1]/Untitled 5""),15)")
    Call Calculate ("Ch(""HCM1_106/HCM_1_HSOV_A2_RELAY_FAIL"")= GetB (Ch(""[1]/Untitled 5""),16)")
    Dim k, m, pMyChn, result, ArincTrue, intMyHandle01, intMyHandle02,intMyHandle03,intMyText, intMyError01, intMyError02, intMyError03
    intMyHandle01 = TextFileOpen("C:\ArincTrue.txt",tfCreate or tfWrite)
    intMyHandle02 = TextFileOpen("C:\ArincFalse.txt",tfCreate or tfWrite)
    intMyHandle03 = TextFileOpen("C:\ArincChange.txt",tfCreate or tfWrite)
    For k = 2 to 4
    For m = 1 to GroupChnCount(k)
    Set pMyChn = Data.Root.ChannelGroups(k).Channels(m)
    Result = ChnValMax(pMyChn)-ChnValMin(pMyChn)
    If Result = 0 and ChnValMax(pMyChn) > 0 then
    intMyText= TextfileWriteLn(intMyHandle01, pMyChn.Name)
    elseif result= 0 and ChnValMax(PMyChn) = 0 then
    intMyText= TextfileWriteLn(intMyHandle02, pMyChn.Name)
    else
    intMyText= TextfileWriteLn(intMyHandle03, pMyChn.Name)
    End If
    Next
    Next
    intMyError01 = TextFileClose(intMyHandle01)
    intMyError02 = TextFileClose(intMyHandle02)
    intMyError03 = TextFileClose(intMyHandle03)
    Solved!
    Go to Solution.

    Hi 2Pale4TX,
    You can't easily reference the content of an ASCII file.  Instead, I suggest you make a new Group of 3 text channels that you can drag onto a REPORT table.
    Dim k, m, z, ResultsGroup, TrueChannel, FalseChannel, ChangeChannel, Group, Channel, Result
    Set ResultsGroup = Data.Root.ChannelGroups.Add("Results")
    Set TrueChannel = ResultsGroup.Channels.Add("ArincTrue", DataTypeString)
    Set FalseChannel = ResultsGroup.Channels.Add("ArincFalse", DataTypeString)
    Set ChangeChannel = ResultsGroup.Channels.Add("ArincChange", DataTypeString)
    For k = 2 to 4
    Set Group = Data.Root.ChannelGroups(k)
    For m = 1 to Group.Channels.Count
    Set Channel = Group.Channels(m)
    ChMax = CMax(Channel)
    ChMin = CMin(Channel)
    Result = ChMax - ChMin
    If Result = 0 and ChMax > 0 Then
    z = TrueChannel.Size + 1
    TrueChannel(z) = Channel.Name
    Elseif Result = 0 and ChMax = 0 Then
    z = FalseChannel.Size + 1
    FalseChannel(z) = Channel.Name
    Else
    z = ChangeChannel.Size + 1
    ChangeChannel(z) = Channel.Name
    End If
    Next ' m
    Next ' k
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • Importing a .csv file into numbers

    thanks in advance for any help you can provide.
    i am a spreadsheet newbie. i am attempting to open a .csv file in numbers. this file when opened on the internet does have each filed seperated by commas, not tabs. when i drag it into numbers, it opens each line in its own row, however it puts the entire information (lets say 5 commas worth) in one column.
    so what i am getting is everything in a numbered row but the program does not appear to be recognizing the commas as a reason to put the information in its own column.
    this is not a life threatening endeavor, i am just trying to organize my guitar magazine collection. i would like to find the song by doing a search of columns/rows and i do not think i can do it as is.
    thanks again...
    Message was edited by: pensncrows

    60wpm wrote:
    I've tried putting in: ¶ - then for MS Word I heard you could put in ^p and/or \n --- but they didn't work.
    !? -- So what do I put in the Replace Text Field box?
    To type a return into the Find/Replace dialogue, Pages uses option-return, Text Wrangler uses command-return (or type \r), haven't checked Text Edit.
    If you Show Invisibles (View menu in Pages, Edit menu > Text Options in Text Wrangler, text Edit doesn't appear to have the option of viewing the invisible characters), you can copy a return, and paste it into the box in pretty much any application that will display the invisible characters. Actually, you should be able to copy the return character even without being able to see it—select from just after the last visible character in a 'paragraph' to the very beginning of the next line, Copy—but it is nice to be able to see what you're doing.
    (I have Pages, MacJournal, Bean, & Text Wrangler and a few other word processing program)
    One note on Pages: Pages does not offer the option to Save as..Text. For that, you have to go File > Export... and choose Plain Text.
    To restate the problem (and I appreciate your help)
    I have a new mailing list with about 100 emails that are separated by commas. The program I'm using seems to require each email be on a separate line. So instead of:
    [email protected], [email protected]
    I want:
    [email protected],
    [email protected]
    So I just want to do a find and replace on "," and replace it with ", carriage return".
    It would be SO GREAT to finally overcome this hurdle.
    Any of the three options above should do the job.
    Regards,
    Barry

  • Import a Zip Code Field Into Numbers

    I'm sure this has been asked before, but I've done a couple of searches and can't find the answer.
    I often need to import a list of addresses into a spreadsheet for cleaning up. In Excel, when I do this, I "open" a text file and get the "import wizard." I can then format the zip code field as a text field and retain any leading zeros (e.g., 00678 is not converted to the number 678).
    How can I do this in Numbers?
    Message was edited by: Joel Mcintosh1

    Blazeland wrote:
    What if the data is of varying lengths? I data with 10, 12 or 13 digit numbers that sometimes have leading zeros. I can't open csv files into Numbers because it deletes the zeros and there is not standard length to the data.
    It's certainly not the reason explaining that you can't open the Numbers generated csv files.
    Numbers put a delimiter between values so their length is meaningless.
    The problem may be the value of the delimiter.
    As I wrote MANY times, if the decimal separator used by the running operating system is period, Numbers use comma as values delimiter.
    If the decimal separator is comma, Numbers use the semi-colon as values separator.
    Yvan KOENIG (from FRANCE mardi 24 mars 2009 21:13:18)

  • I bought Numbers because my Excel files would not work with Mavericks. How can I import a non-functioning Excel file into numbers? (As of now, the file NAME transfers but data is not.) but

    I bought Numbers because my Excel files would not work with Mavericks. How can I import a non-functioning Excel file into numbers? (As of now, the file NAME transfers but data does not.)

    HI Dave,
    I'm surprised you get no message when you attempt opening the Excel document in Numbers.
    I'm assuming Numbers 3.1, since you are running Mavericks.
    Does the Numbers file that opens show any content?
    Does it contain a table?
    How large?
    Does it contain more than one tab (indicating more than one sheet)?
    Do those other tabs contain a table?
    Have you checked those tables for data content?
    There have been cases in the past of imported documents opening with white text on a white background, giving the appearance of containing nothing. Check for this by selecting a block of cells, then applying a Fill colour or a Text colour using the Format button (paintbrush).
    I'd also suggest attempting to open the Excel files using LibreOffice, which can be downloaded from the linked website.
    Regards,
    Barry

  • Import of excel-xml into Numbers '09 vers 2.3

    How can I import excel-xml into Numbers?
    or
    How can I import a CSV-fil into Numbers as a spreadsheet?

    In addition to File/Open you can
    Right click on the file. Open With. Numbers.
    CSV files can also be drag & dropped onto a table and the table will be populated by the contents of the file.

  • Import txt file into user dictionary

    How to import text file into user dictionary through javascript? I can manually import txt file into user dictionary thru "Edit=>Spelling=>User dictionary...". But I don't know how to do it using javascript. Please advise.

    Advice? See in some version of the object-model reference under userDictionary. There you'll find a method called addWord(), which looks promising.
    Peter

  • Is there a way to import a .csv file into Numbers?

    Can I import a .csv file into Numbers?

    Yes, you can import csv (character-separated-values) into Numbers.
    If the csv file is comma-separated, then in Numbers you can try File > Open and navigate to the file and open it.
    If you don't get the results you want, then try this CSV to Tabs on Clipboard Automator Service (Dropbox download) instead.
    To install, double-click the .workflow package and, if necessary, click 'Open Anyway' in System Preferences > Security & Privacy.
    Thereafter to use:
    In Finder (not Numbers) navigate to the .csv file.
    Right-click on the file and choose 'CSV to Tabs on Clipboard' under Services in the contextual menu.
    Follow the prompts (trying different separators if needed).
    Click once in a Numbers cell.
    Command-v to paste.  The Numbers table will expand automatically as needed.
    These steps are quicker and easier than they sound. Just a few clicks and a keyboard entry.
    SG

  • How can I import vcard info into numbers?

    How can I import vcard info into numbers?
    Message was edited by: Clinker1122

    Yes, you should be able to. What have you tried, and what happened?
    Jerry

Maybe you are looking for