我喜欢awk的是,您可以从文件中获取满足您指定的某个任意字段上的条件的所有行。 例如, awk '$3~/hi/' < test.txt # print all lines where the third field matches the pattern "hi"
或 awk '$2>=2' < test.txt # print all lines where the second fiel
这里是我的LINQ查询: GridView.DataSource = from it in DataContext.Items
where it.ThingId == thing.ThingId
select new
{
it.Something,
it.SomethingElse,
it.AnotherSomething,
我想创建一个while循环,只要从文件中取出的字符串不是空的就运行。我需要用空格分隔字符串并保存信息以供将来使用,所以我将子字符串放入数组中,然后将其从实际数组中移除。但是,当我运行该程序时,我不断收到错误消息,或者只是打印出空白区域。 I added a picture of the file I'm using and of the error message I'm getting fstr