【发布时间】:2016-09-20 14:27:39
【问题描述】:
我可以使用一些帮助编写 Applescript 来解析 .txt 文件中的一些文本并输出到单独的 .txt 文件。我需要一个脚本来 1)识别一个部分(由“»=”删除),2)识别一个部分中是否存在一组特定的字符,“[*]”,3)打印包含特定部分的所有部分的部分标题字符集,4) 重复到文件末尾。基本上,这些是带有操作项的注释,我想提取包含打开的操作项的注释。
notes.txt中输入的文本结构如下:
»===============================
<Date> 2016-09-19
<Topic> The topic of the day
<Attendees> Mario, Luigi
»1) Where to go from here
- Someone said this
[*] Mario: schedule this meeting
- And who wants to do that other thing?
»2) And on to the next thing
»3) So on and so forth [*] Luigi can order the pizza
»===============================
<Date> 2016-09-18
<Topic> The topic of the yesterday
<Attendees> Zelda, Wario, Snoop Dog
»1) Where we went from there
- Who said this
[x] Mario: scheduled this meeting yesterday
- And who wants to do that other thing?
»2) And on to the next thing again
»3) So on and so forth * Luigi can order the sausages
»===============================
actionItems.txt 的输出文本如下:
»===============================
<Date> 2016-09-19
<Topic> The topic of the day
<Attendees> Mario, Luigi
»1) Where to go from here
- Someone said this
[*] Mario: schedule this meeting
- And who wants to do that other thing?
»3) So on and so forth [*] Luigi can order the pizza
»===============================
也许我可以得到一些帮助?谢谢!
【问题讨论】:
标签: applescript