10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a file with 48 rows. I am counting 6 rows and adding 6 to that number and repeating the operation, and then output the value in column 1. For the second column, I would like to get sort of a binary output (1s and 2s) every 3rd row. This is what I have:
awk '{print ++src +... (1 Reply)
Discussion started by: Xterra
1 Replies
2. Shell Programming and Scripting
The awk below does put in VUS in the 9th field but I can not seem to skip the header then add the VUS. I tried to incorporate NR >=2 and NR > 1 with no luck. Thank you :).
input
Chr Start End Ref Alt Func.refGene PopFreqMax CLINSIG Classification
chr1 43395635 ... (5 Replies)
Discussion started by: cmccabe
5 Replies
3. Shell Programming and Scripting
I am just trying to insert the word "Index" using awk. The below is close but seems to add the word at the end and I can not get the syntax correct to add from the beginning. Thank you :).
awk -F'\t' -v OFS='\t' '{ $-1=$-1 OFS "Index"}$1=$1' file
current output
Chr Start End ... (3 Replies)
Discussion started by: cmccabe
3 Replies
4. Shell Programming and Scripting
I am trying to match $1-$7 between the two files and if a match is found then the contents of $8 in file2 and copied over. The awk I tried is below. There is also a header row in file2 that has the Chr Start End Ref Alt that does not need to be searched. Thank you :).
awk
awk... (3 Replies)
Discussion started by: cmccabe
3 Replies
5. UNIX for Dummies Questions & Answers
Hi! Is there a way to append column and row header to a file in awk script.
For example if I have
Jane F 39 manager
Carlos M 40 system administrator
Sam F 20 programmer
and I want it to be
# name gend age occup
1 Jane F 39 manager
2 Carlos M ... (4 Replies)
Discussion started by: FUTURE_EINSTEIN
4 Replies
6. Shell Programming and Scripting
Hi,
I'm using AIX(ksh shell).
> cat temp.txt
"a","b",0
"c",bc",0
"a1","b1",0
"cc","cb",1
"cc","b2",1
"bb","bc",2
I want the output as:
"a","b","c","bc","a1","b1"
"cc","cb","cc","b2"
"bb","bc"
I want to combine multiple lines into single line where third column is same.
Is... (1 Reply)
Discussion started by: samuelray
1 Replies
7. Shell Programming and Scripting
I'm working on a different stage of a project that someone helped me address elsewhere in these threads.
The .docs I'm cycling through look roughly like this:
1 of 26 DOCUMENTS
Copyright 2010 The Age Company Limited
All Rights Reserved
The Age (Melbourne, Australia)
November 27, 2010... (9 Replies)
Discussion started by: spindoctor
9 Replies
8. Shell Programming and Scripting
Hi experts a have a very large file and I need to add two columns: the first one numbering the incidence of records and the another with the total count
The input file:
21 2341 A
21 2341 A
21 2341 A
21 2341 C
21 2341 C
21 2341 C
21 2341 C
21 4567 A
21 4567 A
21 4567 C
... (6 Replies)
Discussion started by: juelillo
6 Replies
9. Shell Programming and Scripting
Hi Experts,
The question may look very silly by seeing the title, but please have a look at it clearly.
I have a text file where the first 5 columns in each row were supposed to be attributes of a sample(like sample name, number, status etc) and the next 25 columns are parameters on which... (3 Replies)
Discussion started by: ks_reddy
3 Replies
10. Shell Programming and Scripting
Hi,
Tried to look for solution, and found something similar but could not adapt the solution for my needs..
I'm trying to match a pattern (in this case "ProcessType")in a logfile, then delete that line and the 4 following lines.
The logfile looks as follows:
ProcessType: PROCESS_A... (5 Replies)
Discussion started by: Juha
5 Replies