Search Results

Search: Posts Made By: biopsy
7,973
Posted By ctsgnb
a lazy way : grep -i "snp1" *.txt | awk...
a lazy way :
grep -i "snp1" *.txt | awk 'NR>1{print $NF;next}1' | xargs >new_file
7,973
Posted By Yoda
awk ' BEGIN { printf...
awk ' BEGIN {
printf "SNP\tBP\tCHR\tP\n"
} $1 == "snp1" {
n = $1 "\t" $2 "\t" $3
if ( n in R1 )
RN[n] = RN[n] "\t" $NF
else
{
...
7,973
Posted By ctsgnb
Are you trying to do this only for snp1 or for...
Are you trying to do this only for snp1 or for each snpX ?
3,547
Posted By bakunin
If you already have the list in a file, just...
If you already have the list in a file, just "cat" it into the loop. The loop just takes one file name in every run, so as long as you provide this one filename all is fine. "ls" would have provided...
3,547
Posted By Scrutinizer
Just shell and cat: { read filename cat...
Just shell and cat:
{
read filename
cat "$filename"
while read filename
do
{
read # use "read; read" to skip two header lines
cat
} <...
3,547
Posted By jgt
I think that you can change the above to: ...
I think that you can change the above to:

p=2
k=0
cat file1 >>EUR.all.Fst
while read file
do
while read line
do
if [ k -eq 1 ] ...
3,547
Posted By bakunin
You didn't tell us if there is any naming...
You didn't tell us if there is any naming convention on the file names, so it is difficult to suggest a loop where you don't have to name the possible file names but instead generate them. In any...
3,547
Posted By jgt
p=2 k=0 cat EUR.1.fst >EUR.all.fst ...
p=2
k=0
cat EUR.1.fst >EUR.all.fst
while [ p -lt 561 ]
do
while read line
do
if [ k -eq 1 ]
then
...
4,256
Posted By elixir_sinari
awk 'BEGIN{srand()} NR%10 ==...
awk 'BEGIN{srand()}
NR%10 == 1{i=int(rand()*10+1)}
{i=(i>10)?1:i;print > (FILENAME "_" i++)}' file
Is this OK?
Not very random though.
4,256
Posted By elixir_sinari
Replace srand with srand().
Replace
srand
with
srand().
Showing results 1 to 10 of 10

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