Search Results

Search: Posts Made By: smitra
3,051
Posted By MadeInGermany
awk 'NR==FNR {k[$1]+=$2; next} ($1 in k) {print...
awk 'NR==FNR {k[$1]+=$2; next} ($1 in k) {print $0,k[$1]; next} ($2 in k) {print $0,k[$2]}' file1 file2
Three implicit if clauses, followed by {action} where each action ends with a jump to the next...
3,051
Posted By zaxxon
There we go. It makes it much easier to help when...
There we go. It makes it much easier to help when relevant examples are given ;)
So I made an example of your given input and arranged some matched in file1 and file2.

Try:

$ cat file1...
2,131
Posted By krishmaths
I guess the below command stops printing after it...
I guess the below command stops printing after it encounters a "-" in 2nd column.
awk '$2 ~ !/-/{print $0}' filename

The grep -v should work fine. Are you sure you don't have any other "-" in...
2,131
Posted By Just Ice
grep -v "\-" file
grep -v "\-" file
2,131
Posted By vidyadhar85
Is your file comma seperated? if space...
Is your file comma seperated? if space seperated..


awk '$2 ~ !/-/{print $0}' filename
2,131
Posted By krishmaths
try this awk '{if ($2!="-") print}' file.txt...
try this

awk '{if ($2!="-") print}' file.txt

or


awk '$2!="-" {print} ' file.txt
7,833
Posted By bartus11
Try:awk 'NR==1{for (i=1;i<=NF;i++) if...
Try:awk 'NR==1{for (i=1;i<=NF;i++) if ($i~"^Peak.Area") {printf $i" ";a[i+1]=1};printf "\n"}
NR>1{printf $1" ";for (i=2;i<=NF;i++) if (i in a) printf $i" ";printf "\n"}' file
3,258
Posted By alister
It is extremely bad practice to pass...
It is extremely bad practice to pass miscellaneous text where printf requires a format string. In awk, worst case is a runtime error. With C, it's a massive security hole. For more info, read...
3,258
Posted By pamu
These are few.... As per user defined might...
These are few....

As per user defined might be lit bit difficult to configure with my scripts..
To remove 3 and 5 column.

first=3
second=5
awk -v FR="$first" -v SE="$second"...
3,258
Posted By pamu
Try this.. awk -F, '{ $1="" }1'...
Try this..


awk -F, '{ $1="" }1' input.txt
6,047
Posted By Corona688
Okay, I see. I found this...
Okay, I see.

I found this (http://pngu.mgh.harvard.edu/~purcell/plink/binary.shtml) which seem to show what you need.

Given test.ped and test.map, to create test.bed you run this. Note the...
6,047
Posted By Corona688
I was really confused until I figured out there's...
I was really confused until I figured out there's two applications named plink, and you weren't talking about an ssh client :D

What, exactly, did you try? What, exactly did it do? Did you or did...
5,690
Posted By CarloM
When your field separator is something other than...
When your field separator is something other than whitespace (e.g. if you were processing a simple CSV file you would use a comma instead).
5,690
Posted By elixir_sinari
First of all, you need to quote your script to...
First of all, you need to quote your script to prevent processing by shell. Also, there is no need for -F' ' as the default FS (field separator) in awk is a space. Also, $0 means the whole input line...
5,690
Posted By delugeag
you must put the awk code between quotes ! ...
you must put the awk code between quotes !

awk -F ' ' '{printf "%s\t%s\t%s\t%s\t%s\t%s",$15,$2,$0,$16,$4,$5;}' <test.txt> test.bim
Showing results 1 to 15 of 15

 
All times are GMT -4. The time now is 03:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy