Powershell 选择对象跳过多行? [英] Powershell select-object skip multiple lines?

查看:52
本文介绍了Powershell 选择对象跳过多行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用 -skip 选项跳过多行吗?

Can i skip multiple lines with the -skip option?

gc d:\testfile.txt | select -skip 3

有效,但如果我想删除第 3-7 行怎么办??

works but what to do if i want to delet line 3-7 ??

推荐答案

您还可以使用 readcount 属性来排除行:

You can also use the readcount property to exclude lines:

get-content d:\testfile.txt | where {$_.readcount -lt 3 -or $_.readcount -gt 7}

这篇关于Powershell 选择对象跳过多行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆