0
我試圖創建一個將從CSV文件中創建一個字符串的applescript。創建整個文件的字符串非常容易,但我希望能夠掃描特定組織的文件。以下是我的輸入和期望的輸出。使用AppleScript從CSV查找創建字符串
我的CSV:
Org1 Bobby Bob [email protected]
Org1 Wendy Wen [email protected]
Org1 Rachel Rach [email protected]
Org2 Timmy Tim [email protected]
Org2 Ronny Ron [email protected]
Org2 Mike Mik [email protected]
我的AppleScript:
set csv to read csv_input_file as «class utf8»
set text item delimiters to ","
set csvParagraphs to paragraphs of csv
repeat with current_line in paragraphs of csv
set organization to text item 1 of current_line
--THIS IS WHERE I NEED HELP
set others_in_organization to ...
end repeat
所需的輸出:
我想創建一個包含逗號分隔的新字符串目前所有其他人的名單租賃組織。例如,第四個條目的組織是「Org2」。所以弦會返回「Timmy Tim,Ronny Ron,Mike Mik」。
任何幫助將是偉大的!謝謝!