trying to put text from a docx into a xlsx via applescipt

Discussion in 'Mac Programming' started by mnonat, Apr 22, 2012.

  1. mnonat, Apr 22, 2012
    Last edited: Apr 22, 2012

    mnonat macrumors newbie

    Apr 22, 2012
    Hi there,

    i really need help ....:/

    i am trying to write a applescipt but i really have no idea where to start.

    is there anybody who can help?

    this is what i am trying to do...

    i do have a word sheet and it looks like this

    Siemens Aktiengesellschaft 80333 München EUR 73515 Mio (Konzernumsatz 2011), EUR 7... 350500 (Konzernbeschäftigte 2011), 402700 (2...
    Robert Bosch Gesellschaft mit beschränkter Haftung 70839 Gerlingen EUR 47259 Mio (Konzernumsatz 2010), EUR 3... 274530 (Konzernbeschäftigte 2011), 276418 (2...
    HERAEUS HOLDING Gesellschaft mit beschränkter H... 63450 Hanau EUR 22000 Mio (Konzernumsatz 2011), EUR 2... 13000 (Konzernbeschäftigte 2011), 12569 (201...
    MAN SE 80805 München EUR 14675 Mio (Konzernumsatz 2010), EUR 1... ca. 46000 (Konzernbeschäftigte 2011), 45885 (...
    Aurubis AG 20539 Hamburg EUR 9000 Mio (Konzernumsatz 2011), EUR 98... 6200 (Konzernbeschäftigte 2012), 6200 (2011),...

    what i am trying, is to put this data in a excel sheet...

    the first part is the company till the ZIP code 12345 the next one is the city... and so on...

    i am really desperate.... :/

    so i am very thankful if there is anybody who can help....!!!
  2. sero macrumors member

    Aug 28, 2008
    well, I guess step 1 will be converting docx to something useful, like plain text for example. There should be a script floating around for that.
    Then you can use awk|cut|etc to grab the data you want and dump it in a csv (why excel??).

    Then you're done.
  3. Mac_Max macrumors 6502

    Mar 8, 2004
    Is each entry on its own line? If so you could save it as plain text, with the .csv extension appended, and import it into Excel as a comma separated values file. Each line will go into its own row and each line of text separated by a comma will go into its own column.


    Name, Address1, Address2, City, State, Zip

    this will map roughly to:

    A | B | C | D | E | F
    Name | Address1 | Address2 | City | State | Zip

    Then you can save it as an excel file.

Share This Page