10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi, I have a shell script which analyses the log folder for a specific string and throws me the output. I have used for loop since it does this in multiple servers. Now I want to save the output in a excel in the below format. Can someone please help?
The output which I get
Server1 : count... (14 Replies)
Discussion started by: srilaxman
14 Replies
2. Programming
Hi all,
If i would like to process a file input as below:
col1 col2 col3 ...col100
1 A C E A ...
3 D E G A
5 T T A A
6 D C A G
how can i perform a for loop to count the occurences of letters in each column? (just like uniq -c ) in every column.
on top of that, i would also like... (8 Replies)
Discussion started by: iling14
8 Replies
3. Shell Programming and Scripting
input
name a1 a2 a3
g1 0.8 0.4 0.2
g2 -0.2 -0.6 -0.7
g3 0.1 0.6 0.8
g4 0.1 0 0
g5 -0.2 -0.2 -0.2
g6 -0.1 -0.9 -0.9
g7 0 0 0.2
output
a1:2
a2:0
a3:0
I use the following
awk '{if ($2>=0.5) print $1"\t""1";... (3 Replies)
Discussion started by: quincyjones
3 Replies
4. Shell Programming and Scripting
I have 2 files, that look like this:
ID SNP1 SNP2 SNP3 SNP4
A1 1 2 0 2
A2 2 0 1 1
A3 0 2 NA 1
A4 1 1 0 2
and this:
SNP score
SNP1 0.5
SNP2 0.7
SNP3 0.8
SNP4 0.2
Basically, all of the SNP-values are 0,1, 2 or NA, and they each have a score, listed in the second file. The total... (5 Replies)
Discussion started by: kayakj
5 Replies
5. Shell Programming and Scripting
Hello,
I have a single text file with three columns like:
2 1 10
3 6 11
4 4 12
5 5 13
6 8 14
I was wondering how I can run a shell script to (do loop) to read the first point in the first column , compare it with all the points in the second column and if they are the same,... (12 Replies)
Discussion started by: Paul Moghadam
12 Replies
6. Shell Programming and Scripting
I have two files like this:
fileA.net
A
B
C
fileA.dat
1
2
3
and I want the output
output_expected
A 1
B 2
C 3
I know that the easier way is to do a paste fileA.net fileA.dat, but the problem is that I have 10,000 couple of files (fileB.net with fileB.dat; fileC.net with... (3 Replies)
Discussion started by: valente
3 Replies
7. UNIX for Dummies Questions & Answers
Hello,
I have a file with 32 columns and I want to print one column at a time, and then read each line of this column in order to use grep command.
I tried with awk but i cannot put variable in awk
for a in {1..32..1};do awk '{print$a}' file1.txt|while read line;do grep $line file2.txt;done >... (5 Replies)
Discussion started by: FelipeAd
5 Replies
8. Shell Programming and Scripting
Hi
I have a file with 3 columns. say,
infile:
1 50 68
34 3 23
23 4 56
-------
-------
I want to generate n files from this file using a loop so that 1st column in output file is (column1 of infile/(2*n+2.561))
I am doing like this:
for ((i=1; i<=3; i++))
do
a=`echo... (3 Replies)
Discussion started by: Surabhi_so_mh
3 Replies
9. Shell Programming and Scripting
Hi Everyone:
My shell script creates multiple csv files (~30) in for loop. I want to compile (or merge) 3rd column from each (all) of these files to another file (in loop). Please help. Thanks. (3 Replies)
Discussion started by: smap007
3 Replies
10. Shell Programming and Scripting
Hi all,
I am getting following output by using commands like sort, uniq and awk to the standard output.
110 d
40 a
59 c
9 b
3 e
Now at the end I would like to add all the numbers in column 1 and display the count of all numbers i.e. (110 + 40 + 59 + 9 + 3).
Also the output may... (3 Replies)
Discussion started by: tenderfoot
3 Replies