Search Results

Search: Posts Made By: johnkim0806
816
Posted By johnkim0806
Addition of columns in a loop
I would like to add the numbers in 2nd column and 5th, 8th and 11th, and so forth till the end of the file then print them in one file.

Thanks,
24,489
Posted By johnkim0806
How to convert excel file to csv file or text file?
Hi all,

I need to find a way to convert excel file into csv or a text file in linux command. The reason is I have hundreds of files to convert. Another complication is the I need to delete the...
6,228
Posted By johnkim0806
This is much easy to read! Thanks :)
This is much easy to read! Thanks :)
6,228
Posted By johnkim0806
I also found that this works as well awk '{for...
I also found that this works as well
awk '{for (i=1;i<=NF;i++) {$1=($i<$1)?$i:$1} print $1}' file.txt
6,228
Posted By johnkim0806
How to find a minimum value of a row?
input


1 2 3 4 5 2 8
2 1 1 1 4 2 1
5 4 4 4 2 1 3
2 2 6 7 4 5 4
5 5 5 4 3 3 5



I woud like to print a min of each row such that my output would look like


1
1
1
2
3
1,511
Posted By johnkim0806
this works! superb :)
this works! superb :)
6,129
Posted By johnkim0806
Random ordering
1
2
4
5
3


I would like to use a script so that i can randomly rearrange these numbers such as


3
5
2
4
1


Thanks!
1,511
Posted By johnkim0806
[Solved] Permutation
Hi, I am trying to permutate each column (Except for IDS).

file.txt



FID IID TOAST1 TOAST2 TOAST3
ID3 ID3 1 -9 2
ID4 ID4 2 1 1
ID1 ID1 -9 -9 1
ID8 ID8 1 1 -9
ID12 ID12 1 2 2


...
994
Posted By johnkim0806
i was missing ' ' sign. Thanks!
i was missing ' ' sign. Thanks!
994
Posted By johnkim0806
right, but how do it make it in a loop such that...
right, but how do it make it in a loop such that it can do it for

toast1, ICH, ICH_SV



this is the idea, but i can't put ${i} in sed...
994
Posted By johnkim0806
Replacing a variable in a loop
input.txt



I want to make 3 seprate ouputs such that

toast1.txt



ICH.txt


ICH_SV.txt


I have tried "echo" and "sed 's/k/toast1/g' to replace k, but its not quite working....
8,544
Posted By johnkim0806
R plots in UNIX platform
How do you see plots produced in R under UNIX platform?
Thanks!
1,416
Posted By johnkim0806
it is fixed now
it is fixed now
1,416
Posted By johnkim0806
Find the maximum of a value
0.01 0.6 0.39
0.4 0.3 0.3
1 0 0
0 0 1



I would like to print 2 if the maximum of a row is the first column
I would like to print 1 if the maximum of a row is the second colum
print 0 if...
1,413
Posted By johnkim0806
Separate two numbers
I would like to separate number by space so that


121231212
222111212


would be


1 2 1 2 3 1 2 1 2
2 2 2 1 1 1 2 1 2


Thanks!
1,262
Posted By johnkim0806
bash-3.2$ n= $(wc -l < ${data}/index_new) bash:...
bash-3.2$ n= $(wc -l < ${data}/index_new)
bash: 3758: command not found


i got this...
1,262
Posted By johnkim0806
extracting number of rows
if
> wc -l data.txt
> 100

(meaning there are 100 rows)

i want to assgn 100 as n so that if i do
>echo n
it would give me
100

Thanks
1,112
Posted By johnkim0806
awesome thanks!
awesome thanks!
1,112
Posted By johnkim0806
adding one more column in a loop
data1
1 0.01 3 5
1 0.6 2 1

data2
2 0.02 3 5
2 0.3 2 1

data3
3 0.01 3 5
3 0.01 2 1

output

1 0.01 data1
2 0.02 data2
3 0.01 data3
3 0.01 data3

I want to print 1st, 2nd...
1,707
Posted By johnkim0806
if i had more than 2 files, 6 files in my case ...
if i had more than 2 files, 6 files in my case
I used

join -a1 -a2 -e "NA" -o 2.1 1.2 2.2 ${metabo}/p.adjust_${i}_toast1 ${metabo}/p.adjust_${i}_toast2 \
| join -a1 -a2 -e "NA" -o 2.1 1.2 2.2...
1,707
Posted By johnkim0806
this works! wonderful!
this works! wonderful!
1,707
Posted By johnkim0806
what does -e "NA" -o mean?
what does -e "NA" -o mean?
1,707
Posted By johnkim0806
yeah ive sorted them ---------- Post updated...
yeah ive sorted them

---------- Post updated at 03:07 PM ---------- Previous update was at 03:06 PM ----------

i just dont know how to get NA
1,707
Posted By johnkim0806
join two files
Hi,

File1.txt

SNP2 1
SNP3 1
SNP5 1
SNP4 1


File2.txt

SNP3 2
SNP1 2
SNP5 2
SNP4 2
SNP2 2


I want output like this.
5,990
Posted By johnkim0806
is there any way that you can put them in the...
is there any way that you can put them in the order you want?
Showing results 1 to 25 of 57

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