string - 使用 powershell 在两个部分之间更新文本文件
问题描述
我想检查 [section3] 和 [section4] 之间的文本并在第 4 行之后插入一个新行。我如何使用 powershell 来做到这一点,有什么指针可以做到这一点吗?
样本.txt
[Section1]
around 100Lines of text
[Section2]
around 100Lines of text
[Section3]
Line1
Line2
Line3
Line4
Line5
Line6
[Section4]
100Lines of test
[Section5]
解决方案
推荐阅读
- javascript - 如何在 Javascript 中将 PNG 转换为 SVG
- java - 从另一个类调用静态变量到可运行
- html - Bootstrap 4 确实有问题(导航栏和弹性对齐)
- python - Heroku Django 应用程序没有服务,因为 ModuleNotFoundError 崩溃:
(*不是需求模块*)? - selenium - 如何使用 selenium 点击这个按钮?
- javascript - onclick javascript函数不适用于div元素
- css - 我的 css first-child 伪选择器以相反的方式工作
- c - 虽然循环在C中被跳过
- list - F#关于打字的问题,float*float类型与'float'类型不匹配
- android-studio - 构建失败并出现异常。颤动的Gradle问题