10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi Team,
i need to list only those number from the input file which begin with 24
input file is
2412
2413
2456
2134
2134
2244
2526
expected output i want is
2412
2413
2456 (6 Replies)
Discussion started by: scriptor
6 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
Hi
I want to use awk to match where field 3 contains a number within string - then print the line and just the number as a new field.
The source file is pipe delimited and looks something like
1|net|ABC Letr1|1530|||
1|net|EXP_1040 ABC|1121|||
1|net|EXP_TG1224|1122|||
1|net|R_North|1123|||... (5 Replies)
Discussion started by: Mudshark
5 Replies
5. Shell Programming and Scripting
Need to transpose every 2 fields of a row into a single 2 field column.
input
4 135 114 76 217 30 346 110
5 185 115 45 218 85 347 125
6 85 116 130 220 65 352 95
11 30 117 55 221 42 355 75
16 72 118 55 224 37 357 430
17 30 119 55 225 40 358 62
21 52 120 65 232 480 360 180
....... (8 Replies)
Discussion started by: sdf
8 Replies
6. Shell Programming and Scripting
Hi all,
I have a tab-delimited text file of size 10Mb. I am trying to count the number of lines using,
grep -c . sample.txtor
wc -l < sample.txt or
awk 'END {print NR}' sample.txtAll these commands shows the count as 1, which means they are reading only the first header line of the file.... (3 Replies)
Discussion started by: mehar
3 Replies
7. Shell Programming and Scripting
Dear all,
I have been trying to print an entire field, if the first line of the field is matching.
For example, my input looks something like this.
aaa ddd zzz
123 987 126
24 0.650 985
354 9864 0.32
0.333 4324 000
I am looking for a pattern,... (5 Replies)
Discussion started by: Chulamakuri
5 Replies
8. Shell Programming and Scripting
Hi,
This must be simple but I can't get it to work. I have the follow code to insert the contents of a file into an array and then I want to print the value of a container where all of the records in another container within the array start with 33 (that's not all I want to do but it is all I... (2 Replies)
Discussion started by: Donkey25
2 Replies
9. Shell Programming and Scripting
Hi
I've file1 as:
after I read all rows with awk, I need to change some of them.
I mean, for example if the last row is zero then change row number 4 in zero too.
So I'd like to refers each row as a vector and change its value accordly some conditions. I know that NR keep just the "current"... (2 Replies)
Discussion started by: Dedalus
2 Replies
10. Shell Programming and Scripting
i have a several million line file like this:
M:charitygeneral:water:fairbanks:charitygeneral
field 2 and field 5 are the same
i want to read the file and rot13 or any caesar cipher field 2 and replace the with a random number 1 - 9
anyone know how to do this?
something slightly... (8 Replies)
Discussion started by: bathtub
8 Replies