#onelinertips #awk #linux #bioinformatics
How to compare two columns (mid) in a file if they are identical to each other not ?
File.txt
📢_______
Follow us @llbschool
Join us @letslearnbioinformatics
How to compare two columns (mid) in a file if they are identical to each other not ?
File.txt
mid A1 A2 mid A3 A4 A5 A6
18 we gf 18 32 23 45 89
19 ew fg 19 33 24 46 90
21 ew fg 21 35 26 48 92
22 ew fg 21 35 26 48 92
Solution 1:awk '$1!=$4{ print $1,$4}' file.txt
Solution 2:diff <(awk '{print $1}' file.txt) <(awk '{print $4}' file.txt)📢_______
Follow us @llbschool
Join us @letslearnbioinformatics
file1.txt
123 B
#letshare #knowledge #topic #bioinformatics #awk
How to compare two columns in a file and print the no's repeated in different columns ?
File1.txt (attached for try)
@letslearnbioinformatics
How to compare two columns in a file and print the no's repeated in different columns ?
File1.txt (attached for try)
18 we gf 18 32 23 45 89
19 ew fg 19 33 24 46 90
21 ew fg 21 35 26 48 92
22 ew fg 21 35 26 48 92
Expected answer:23👨🏻💻 Comment your one liner solutions in the discussion 👇
21
@letslearnbioinformatics
#bioinformatics #awk #sed #linux
Bioinformatics one-liners
- Sources
- Basic awk & sed
- awk & sed for bioinformatics
- sort, uniq, cut, etc.
- find, xargs, and GNU parallel
- seqtk
- GFF3 Annotations
- Other generally useful aliases for your .bashrc
- Etc.
🌐More details:
https://github.com/stephenturner/oneliners/blob/master/README.md#etc
📢«««««««
Channel @llbschool
Forum @letslearnbioinformatics
Bioinformatics one-liners
- Sources
- Basic awk & sed
- awk & sed for bioinformatics
- sort, uniq, cut, etc.
- find, xargs, and GNU parallel
- seqtk
- GFF3 Annotations
- Other generally useful aliases for your .bashrc
- Etc.
🌐More details:
https://github.com/stephenturner/oneliners/blob/master/README.md#etc
📢«««««««
Channel @llbschool
Forum @letslearnbioinformatics
👍9❤3