is there in c# cmd similar to AWK in shell?
root@U2KPriamry # echo " JD2BSC01 BCF-0341 BTS-0707 QUAL "| awk '{print $4}'
BTS-0707
root@U2KPriamry #
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Jan 6, 2015, 8:52 AM
Abdullah DhiabPosted Jan 7, 2015, 11:24 AM
VulpesPosted Jan 7, 2015, 5:47 AM
The File.ReadLines() method reads the lines of the file one by one, without storing them all in memory at the same time, which is important if you have 50,000 lines to read.
For each line, an anonymous 'tuple' is then created consisting of the text of the line and the line number (starting from 1).
These tuples are then filtered so that only those whose 'text' property includes the search word are returned.
The foreach statement then iterates through the filtered tuples and prints to the console the line number and the text of the matched line.
So it sounds like that's what you want.
Abdullah DhiabPosted Jan 7, 2015, 4:49 AM
i need to search in text file for a string, if its there get whole line where its located..
i found below example but could not understand it, ideas?
VulpesPosted Jan 6, 2015, 10:50 AM
Abdullah DhiabPosted Jan 6, 2015, 9:23 AM
Abdullah DhiabPosted Jan 6, 2015, 9:21 AM
Abdullah DhiabPosted Jan 6, 2015, 7:56 AM
Abdullah DhiabPosted Jan 6, 2015, 7:42 AM
Abdullah DhiabPosted Jan 6, 2015, 7:38 AM
Wim SturkenboomPosted Jan 6, 2015, 6:26 AM
Abdullah DhiabPosted Jan 6, 2015, 4:16 AM