Lets Learn Bio-IT School 🇫🇷🇮🇳
6.51K subscribers
3.31K photos
127 videos
777 files
4.41K links
We provide every possible information's to bring the Biologists and Bioinformaticians together under one roof.

External events, ads, news, queries and other requests can be shared via @ContactezNous_bot

🌐 To xplore us https://linktr.ee/nyberman
Download Telegram
#onelinertips #awk #linux #bioinformatics

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)
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
21

👨🏻‍💻 Comment your one liner solutions in the discussion 👇

@letslearnbioinformatics