Posts

Showing posts from December 8, 2018

Mukandpur

Image
village in Punjab, India Mukandpur village Mukandpur Location in Punjab, India Show map of Punjab Mukandpur Mukandpur (India) Show map of India Coordinates: 31°07′33″N 75°56′41″E  /  31.1257747°N 75.9447956°E  / 31.1257747; 75.9447956 Coordinates: 31°07′33″N 75°56′41″E  /  31.1257747°N 75.9447956°E  / 31.1257747; 75.9447956 Country   India State Punjab District Nawanshahr Population (2001)  • Total 3,785 Languages  • Official Punjabi Time zone UTC+5:30 (IST) Vehicle registration PB- Coastline 0 kilometres (0 mi) Mukandpur is a village near Banga, Nawanshahr district (also known as Shahid Bhagat Singh Nagar) in Punjab, India. [1] Contents 1 Demographics 2 Shopping 3 Education 3.1 Schools 3.2 Amardeep Singh Shergill Memorial College Mukandpur 3.3 Amardeep Mela 4 Chaunkian da Mela 5 See also 6 References Demographics According to the 2001 Census, [2] Mukan...

How to feed awk input from both pipe and file?

Image
up vote 2 down vote favorite I was wondering how do I get awk to take a string from the pipe output and a file? I've basically have a chain of commands that eventually will spit out a string. I want to check this string against a csv file (columns separated by commas). Then, I want to find the first row in the file that contains the string in the 7th column of the csv file and print out the contents of the 5th column of that line. Also, I don't know linux command line utilities/awk too well, so feel free to suggest completely different methods. :) CSV file contents look like this: col1,col2,col3,col4,col5,etc... col1,col2,col3,col4,col5,etc... etc... My general line of thought: (rest of commands that will give a string) | awk -F ',' 'if($5 == string){print $7;exit}' filename.txt Can this be do...