Skip to content
Advertisement

Tag: awk

Problem filtering 2 files using AWK for a given condition

First of all, thank you for your help. I have a problem filtering 2 files using AWK conditionals. The two files I want to filter are these one: Fasta.fa species_id (the file is larger and contain the name of different species) I want to use awk so it puts in fasta.fa the name of the species if both $2 in

Unexpected characters coming in bash in while loop

I am trying to get IP of a few 1000 domains… below is my program… it shows me sh -x domains-ip.sh $ and ‘ and r is not something I was expecting… Any idea where I am doing wrong? I check While Loop in Bash Unexpected Character but the selected answer I am also using… PS: is there any better

How to get consolidated count of delimiter occurrence

I have a requirement to fetch the count the occurrence of ‘|’ in each line of a file then match the count with given inputcount, needs to throw exception when the count is wrong. Say if the inputcount=3 and the file has following content then exception should get thrown on executing the line 2 and it should exit the file.

How can I select only the rows In file 1 that match column values in file 2?

I have multiple measurements per ‘Subject’ in file 1. I only want to use the highest quality, singular measurement per Subject. In my second file I have the exact list of which measurement is the best for each Subject. This information is contained in the column ‘seriesnumber’. The number in the ‘seriesnumber’ column in file 2 corresponds to the best

grep to read exact data from text file

I have file test1.txt file, i am trying to read variable which is enclosed in double quotes and starting with hyphen for eg: “-color”. i trying to use this grep command cat test1.txt | grep getParm | sed ‘s/getParm(/ /;s/&/ /;s/,/ /;s/”/ /g’ | awk ‘{print $3}’ , where i am not able to read exact data for all variables

Advertisement