Einzelnen Beitrag anzeigen
Alt 13-02-2010, 20:52   #11 (permalink)
iScript
MU Mitglied
 
Benutzerbild von iScript
 
Registriert seit: 02.2007
Beiträge: 139
set csvfolder to choose folder with prompt "CSV-Ordner auswählen"
set csvdata to (do shell script "grep -h '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9],*' " & quoted form of POSIX path of csvfolder & "*.csv | sort")

set quoteLines to paragraphs of csvdata
set row_count to count of quoteLines
set col_count to 2

tell application "Numbers"
   activate
   tell document (count of documents)
      tell sheet 1
         make new table with properties {name:"Daten", row count:row_count, column count:col_count}
         tell table (count of tables)
            set nRow to 1
            repeat with aLine in quoteLines
               set AppleScript's text item delimiters to ","
               set line_data to every text item of aLine
               set AppleScript's text item delimiters to ""
               
               repeat with i from 1 to col_count
                  set value of cell i of row nRow to ((item i of line_data) as text)
               end repeat
               set nRow to nRow + 1
            end repeat
         end tell
      end tell
   end tell
end tell
               
iScript ist offline   Mit Zitat antworten