10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi forum members,
I'm trying to get an average of multiple columns in a csv file using awk. A small example of my input data is as follows:
cu,u3o8,au,ag
-9,20,-9,3.6
0.005,30,-9,-9
0.005,50,10,3.44
0.021,-9,8,3.35
The following code seems to do most of what I want
gawk -F","... (6 Replies)
Discussion started by: theflamingmoe
6 Replies
2. Shell Programming and Scripting
Hello All;
I have two files with below conditions:
1. Entries in file A is missing in file B (primary is field 1)
2. Entries in file B is missing in file A (primary is field 1)
3. Field 1 is present in both files but Field 2 is different.
Example Content:
File A
... (4 Replies)
Discussion started by: mystition
4 Replies
3. Shell Programming and Scripting
Hi guys,
I have hundreds file like this, here I only show two of them:
file 1
feco4_s_BB95.log ZE_1=-1717.5206260
feco4_t_BB95.log ZE_1=-1717.5169250
feco5_s_BB95.log ZE_1=-1830.9322060... (11 Replies)
Discussion started by: liuzhencc
11 Replies
4. Shell Programming and Scripting
Hi everyone!!
I need to apply a simple command to extract columns from a matrix, but I need to extract contemporary from the first to the tenth columns, than from the eleventh to the twentyth and so on...
how can i do that? (1 Reply)
Discussion started by: gabrysfe
1 Replies
5. Shell Programming and Scripting
Hi,
Input
7488 7389 chr1.fa chr1.fa
3546 9887 chr5.fa chr9.fa
7387 7898 chrX.fa chr3.fa
7488 7389 chr21.fa chr3.fa
7488 7389 chr1.fa chr1.fa
3546 9887 chr9.fa chr5.fa
7898 7387 chrX.fa chr3.fa
Desired Output
7488 7389 chr1.fa chr1.fa 2
3546 9887 chr5.fa chr9.fa 2... (2 Replies)
Discussion started by: jacobs.smith
2 Replies
6. Shell Programming and Scripting
I can't seem to get this to work.
I can reformat the date field if it's the first field (and only field) in the file:
However, I get a syntax error when the date field is the second field (or has any other columns following):
I can use a ";" but then it puts each column on separate... (8 Replies)
Discussion started by: giannicello
8 Replies
7. Shell Programming and Scripting
Hi,
I'm trying to reformat a file to create a new columns reflecting the previous 2 over and over. By that I mean currently each observation has two columns and I want to create a third which has a value equal to 1 minus the sum of the previous two.
This is slightly complicated as 1) I... (6 Replies)
Discussion started by: reformatplink
6 Replies
8. Shell Programming and Scripting
I get the point of number subtraction in one column
awk 'NR==1 {n=$1; next}; {n-=$1} END {print n}' inputfile
but I cannot figure it out how to do this to multiple
columns.
awkward. (6 Replies)
Discussion started by: awkward
6 Replies
9. Shell Programming and Scripting
hi i have file 1 as follows:
6
7
8
9
10
i have file 2 as follows:
5
5
5
5
5
i want file 3 as follows: (4 Replies)
Discussion started by: npatwardhan
4 Replies
10. Shell Programming and Scripting
Hi all,
I have three files, one is a navigation file, one is a depth file and one is a file containing the measured field of gravity. The formats of the files are;
navigation file:
2006 320 17 39 0 0 *nav 21.31542 -157.887
2006 320 17 39 10 0 *nav 21.31542 -157.887
2006 320 17 39 20 0... (2 Replies)
Discussion started by: andrealphus
2 Replies