用于从文件 B 中删除文件 A 中的文本的 PowerShell 脚本
似乎禁止创建查找未使用的 CSS 选择器并实际删除它们的应用程序,它们所做的只是找到它们并创建一个列表(Dust-Me Selectors 附加组件)。自从我迁移到 x64 后,我使用的程序 (Skybound Stylizer) 就不再运行了。
我想获取由 Dust-Me 选择器创建的 CSV 文件,并从 CSS 文件中删除该文件中的每一行。
如果数据格式与 CSS 文件不一致,则可能需要格式化 CSV 文件,但为了解决这个问题,您可以将 CSV 文件中的每一行视为文本字符串。
Dust-Me 选择器示例 .csv 文件:
It seems it is forbidden to create applications that find unused CSS selectors and actually delete them, all they do is find them and create a list (Dust-Me Selectors add-on). The program I used (Skybound Stylizer) doesn't run anymore since I moved to x64.
I want to take the CSV file created by Dust-Me Selectors and delete every line in that file from a CSS file.
It may be necessary to format the CSV file if the data format doesn't agree with the CSS file, but for the sake of this question you can think of each line in the CSV file as a text string.
Dust-Me Selectors sample .csv file:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您想要 CSV 文件和 CSS 文件之间进行逐行匹配,类似这样的操作应该可以工作:(请注意,我或多或少是根据对类似文件所做的操作而即兴执行此操作的,但我不这样做现在请带上脚本进行检查)
如果它不是逐行匹配的行,则将 where 语句更改为如下所示:
If you are wanting a line by line match between the CSV file and the CSS file something like this should work: (Note I did this off the cuff more or less from what I have had to do with similar files, but I don't have the script with me at the moment to check)
If it is not a line for line match then change the where statement to be something like: