我是 TCL 编程的初学者,想从匹配的输入文件中删除行
- 完全相同的行内容
- 模式:(
"ghi\/\njkl\/\nrccu1" -> "Point \.*: 10 Sinks" \.*
单词“Point”后面的数字和“[color.*
”后面的内容可以不同 - 所有其他需要完全匹配) "mno\/\npqr\/\nrccu1" -> "stu\/\nvwx\/\nrccu1" [label = "depth: 1"] [color=salmon] [fontcolor=salmon] [style=solid];
(单词“Point”后面的数字和“[color.*
”后面的内容可以不同-所有其他都需要完全匹配)
现在我有以下输入文件
"abc\/\ndef\/\nrccu1" [形状=八边形,颜色=红色,样式=填充]; "abc\/\ndef\/\nrccu1" [形状=八边形,颜色=红色,样式=填充]; "ghi\/\njkl\/\nrccu1" -> "第 1 点:10 个水槽" [color=salmon] [style=solid] [weight=8]; "123\/\n456\/\nrccu1" -> "第 9 点:10 个水槽" [color=grey] [style=solid] [weight=8]; "ghi\/\njkl\/\nrccu1" -> "第 8 点:10 个水槽" [color=grey] [style=solid] [weight=8]; "ghi\/\njkl\/\nrccu1" -> "第 13 点:20 个水槽" [color=grey] [style=solid] [weight=8]; "mno\/\npqr\/\nrccu1" -> "stu\/\nvwx\/\nrccu1" [label = "depth: 1"] [color=salmon] [fontcolor=salmon] [style=solid]; "mno\/\npqr\/\nrccu1" -> "stu\/\nvwx\/\nrccu1" [label = "depth: 4"] [color=salmon] [fontcolor=salmon] [style=solid]; "mno\/\npqr\/\nrccu1" -> "stu\/\nvwx\/\nrccu1" [label = "depth: 1"] [color=grey] [fontcolor=red] [style=solid];
输出文件应包含:
"abc\/\ndef\/\nrccu1" [形状=八边形,颜色=红色,样式=填充]; "ghi\/\njkl\/\nrccu1" -> "第 1 点:10 个水槽" [color=salmon] [style=solid] [weight=8]; "123\/\n456\/\nrccu1" -> "第 9 点:10 个水槽" [color=grey] [style=solid] [weight=8]; "ghi\/\njkl\/\nrccu1" -> "第 13 点:20 个水槽" [color=grey] [style=solid] [weight=8]; "mno\/\npqr\/\nrccu1" -> "stu\/\nvwx\/\nrccu1" [label = "depth: 1"] [color=salmon] [fontcolor=salmon] [style=solid]; "mno\/\npqr\/\nrccu1" -> "stu\/\nvwx\/\nrccu1" [label = "depth: 4"] [color=salmon] [fontcolor=salmon] [style=solid];