| 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
|