Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
你能帮我写一个 sed 命令从文件中删除价格吗?
输入:
1 台打印机 2 网络交换机 1 82 磅 A4 纸边 20 美元
输出:
1 台打印机 2 网络交换机 1 82 磅 A4 纸边
20 美元从输出中消除。
假设您的数据在 /tmp/foo 中:
sed '/^\$/d' /tmp/foo
使用模式匹配查找以美元符号开头的行,然后从模式空间中删除这些行并开始下一个循环。
我的 ViewModel 包含一些对象(IEnumerable)的集合。集合中的项目按行显示在标签中。当我提交表单时,它会触发提交 jQuery 函数来验证自己。我需要从显示的表中获取值并转换为对象。
看一下这个:
// // the table to display my collection content <div id="publications">