10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
To merge mutiple *.tab files as:
file1.tab
rs1 A A
rs2 A A
rs3 C C
rs4 C Cfile2.ind
rs1 T T
rs2 T T
rs3 G G
rs4 G Gand file3.tab
rs1 B B
rs2 B B
rs3 L L
rs4 L LOutput:
file1.tab file2.tab file3.tab
AA TT BB
AA TT BB
CC GG LL
CC GG ... (4 Replies)
Discussion started by: yifangt
4 Replies
2. UNIX for Dummies Questions & Answers
Hello Unix experts,
If I could get any explanations on why the code below doesn't work it would be great !
My input looks like that ("|" delimited):
Saaaaabbbbbccccc|ok
Sdddddfffffggggg|ok
The goal is, if $2 is "ok", to remove everything before the pattern given in the match function... (5 Replies)
Discussion started by: lucasvs
5 Replies
3. Shell Programming and Scripting
Hi, i'm just after a simple explanation of how the following awk oneliner works.
gawk -F"," '{for(i=m;i<=n;i++)printf "%s" OFS,$i; print x}' m=1 n=70 OFS=, input.csv > output.csv
In particular i'm trying to understand how the two print statements work? How is the "x" variable being assigned... (3 Replies)
Discussion started by: theflamingmoe
3 Replies
4. Shell Programming and Scripting
Hello,
Would someone be able to tell me exactly how this command works please?
awk '!x++'
As usual any help much appreciated (8 Replies)
Discussion started by: Grueben
8 Replies
5. Shell Programming and Scripting
hi all
can any one help me to understand this
bdf -t vfxs | awk '/\//{printf("%-30s%-10s%-10s%-10s%-5s%-10s\n",$1,$2,$3,$4,$5,$6)}'
i want to understand the numbers %-30S% (4 Replies)
Discussion started by: maxim42
4 Replies
6. UNIX for Dummies Questions & Answers
Its great someone provided this script that strips out a filename and extension but can someone explain how each line works?
file1='Jane Mid Doe.txt'
newfile='Jane.txt'
1) ext=${file1##*.}
2) filename=${file%%.???}
3) set -- $filename
4) newfile="1.$extension" (1 Reply)
Discussion started by: Lillyt
1 Replies
7. Shell Programming and Scripting
Could someone give me a quick simple explanation for the AWK command.
And also help me to explain the code i have made. I have made some general comments about it myself. I was wondering if people could help me with the rest:
awk -F'' 'END {
fmt = "%-20s\t%s\t%s\n" ... (0 Replies)
Discussion started by: amatuer_lee_3
0 Replies
8. UNIX and Linux Applications
Hi am having a c pgm. It has the include files (unistd.h,sys/types.h,win.h,scr.h,curses.h,stdarg.h and color.h). I don't know the purpose of these include files. will u plz explain me. (1 Reply)
Discussion started by: Mari.kb
1 Replies
9. Shell Programming and Scripting
how does below tr command replace nonletters with newlines?
I think I understand tr -cs '\n' part.. but what is
A-Za-z\' <--- what is this??
tr -cs A-Za-z\' '\n' |
-c --complement
-s, --squeeze-repeats
replace each input sequence of a repeated character that is... (0 Replies)
Discussion started by: convenientstore
0 Replies
10. Shell Programming and Scripting
Hi,
Could anyone please explain why we have arr=1 - what does this statement do?
awk -F\; 'FNR==NR{arr=1;next};$3 in arr' core.txt gmrd.txt
Any help appreciated (2 Replies)
Discussion started by: penfold
2 Replies