10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
The below awk executes as is and produces the current output. It isvery close but what Ican not seem to do is add the -exon..., the ... portion comes from $1 and the _exon is static and will never change. If there is + sign in $4 then the ... is in acending order or sequential. If there is a - in... (2 Replies)
Discussion started by: cmccabe
2 Replies
2. Shell Programming and Scripting
I am trying to output a tab-delimited result that uses the data from a tab-delimited file to combine and subtract specific lines.
If $4 matches in each line then the first matching sequential $6 value is added to $2, unless the value is 1, then the original $2 is used (like in the case of line... (3 Replies)
Discussion started by: cmccabe
3 Replies
3. Shell Programming and Scripting
In the below I am trying to use awk to match all the $13 values in input, which is tab-delimited,
that are in $1 of gene which is just a single column of text.
However only the line with the greatest $9 value in input needs to be printed.
So in the example below all the MECP2 and LTBP1... (0 Replies)
Discussion started by: cmccabe
0 Replies
4. Shell Programming and Scripting
Trying to output a result that uses the data from file to combine and subtract specific lines. If $4 matches in each line then the last $6 value is added to $2 and that becomes the new$3. Each matching line in combined into one with $1 then the original $2 then the new$3 then $5. For the cases... (4 Replies)
Discussion started by: cmccabe
4 Replies
5. Shell Programming and Scripting
I would like to use printf (or something else?) to create a line of text that has varying column widths. This will be used to create a fixed width file (with varying column widths). For example, consider variables $1 $2 $3 are equal to a, b, c respectively and they should be printed in column... (10 Replies)
Discussion started by: farrenthorpe
10 Replies
6. Shell Programming and Scripting
I have two text files like this:
file1.txt:
133 10
133 22
133 13
133 56
133 78
133 98
file2.txt:
158 38
158 67
158 94
158 17
158 23
I'm basically trying to have awk check the second largest value of the second column of each text file, and cat it to its own text file. There... (13 Replies)
Discussion started by: theawknewbie
13 Replies
7. Shell Programming and Scripting
Hey,
This is a long-shot however, I am stuck with the following problem:
I have the output from ls -la, and I want to sort some of that data out by using AWK to filter it.
ls -la | awk -f scriptname.awk
Input:
For example:
drwxr-xr-x 3 user users 4096 2010-03-14 20:15 bin/... (5 Replies)
Discussion started by: abciscool
5 Replies
8. Shell Programming and Scripting
Hi All,
My file is like this:
$ cat max.txt
abcd:1982:a
efghij:1980:e
klmn:1923:k
opqrst:1982:o
I have to find out the largest first field and the corresponding line. i.e
Output required:
efghij efghij:1980:e
opqrst opqrst:1982:o
HTH,
jkl_jkl (6 Replies)
Discussion started by: jkl_jkl
6 Replies
9. UNIX for Dummies Questions & Answers
I am using the following command at the Unix prompt to make my 'infile' into a fixed width file of 100 characters.
awk '{printf "%-100s\n",$0}' infile > outfile
However, there are some records with a special character "©"
These records are using 3 characters in place of one and my record... (2 Replies)
Discussion started by: alok.benjwal
2 Replies
10. Programming
This one is a bit of bugger and I'm not sure if it's entirely relevant to this board but here goes...
I'm trying to produce some fixed width output to a List widget (X11/Motif GUI) So, I use something similar to:
sprintf(Buffer, "%*d%*f", 20, some_integer, 20, some_float);
This gives me a... (0 Replies)
Discussion started by: trido
0 Replies