Hi guys,
Is there easy way to searcha and count the following.
File1
TCGTCTGCCGTTTTTT
TCTCTGAGGGTCGGT
File2
TCGTCTGCCGTTTTTT
TCGTCTGCCGTTTTTTCCTTG
TCGTCTGCCGTTTTTTCCTTTTCATCTTAAAAAAAA
TCGTCTGCCGTTTTTTCGTTGGCAACAATAAAGTCT
TCGTCTGCCGTTTTTTG
TCGTCTGCCGTTTTTTG
TCGTCTGCCGTTTTTTG
TCGTCTGCCGTTTTTTGATTTTCTCATGCCGACTTT
TCGTCTGCCGTTTTTTGC
TCGTCTGCCGTTTTTTGCT
TCGTCTGCCGTTTTTTGCTCTACCCCCAAAACCCTA
TCGTCTGCCGTTTTTTGCTT
TCGTCTGCCGTTTTTTGCTTG
TCGTCTGCCGTTTTTTGCTTG
TCGTCTGCCGTTTTTTGCTTG
TCGTCTGCCGTTTTTTGCTTGAAAACACACAAAATC
TCGTCTGCCGTTTTTTGCTTGGAATAAAGTCTTAGC
TCGTCTGCCGTTTTTTGCTTGTAAACATACCATCTT
TCGTCTGCCGTTTTTTGCTTGTAACTAAATAAGTAT
TCGTCTGCCGTTTTTTGCTTGTACACATT
TCGTCTGCCGTTTTTTGCTTT
TCGTCTGCCGTTTTTTGCTTT
TCGTCTGCCGTTTTTTGCTTT
TCGTCTGCCGTTTTTTGCTTTAAATATAA
TCGTCTGCCGTTTTTTGCTTTATAAA.AAAAATATA
TCGTCTGCCGTTTTTTGCTTTT
TCGTCTGCCGTTTTTTGCTTTTAAAAATAAAATTTT
TCGTCTGCCGTTTTTTGGTT
TCGTCTGCCGTTTTTTGGTTGAACAACACTACAAAA
TCTCTGAGGGTCGGT
TCTCTGAGGGTCGGT
TCTCTGAGGGTCGGT
TCTCTGAGGGTCGGTTCTTATGCCGTCTTCTGCTTT
I can do individual entry using grep as follows
grep "^TCTCTGAGGGTCGGT" file2.txt | wc -l
I need output like:
TCGTCTGCCGTTTTTT count
TCTCTGAGGGTCGGT count
I don't know how to search for multiple lines of file one in file2 and count which requires sort of loop. By the way, I did a count using perl and found sort of error in count while count using grep and want to check all entries using awk.
Thanks.
Is there easy way to searcha and count the following.
File1
TCGTCTGCCGTTTTTT
TCTCTGAGGGTCGGT
File2
TCGTCTGCCGTTTTTT
TCGTCTGCCGTTTTTTCCTTG
TCGTCTGCCGTTTTTTCCTTTTCATCTTAAAAAAAA
TCGTCTGCCGTTTTTTCGTTGGCAACAATAAAGTCT
TCGTCTGCCGTTTTTTG
TCGTCTGCCGTTTTTTG
TCGTCTGCCGTTTTTTG
TCGTCTGCCGTTTTTTGATTTTCTCATGCCGACTTT
TCGTCTGCCGTTTTTTGC
TCGTCTGCCGTTTTTTGCT
TCGTCTGCCGTTTTTTGCTCTACCCCCAAAACCCTA
TCGTCTGCCGTTTTTTGCTT
TCGTCTGCCGTTTTTTGCTTG
TCGTCTGCCGTTTTTTGCTTG
TCGTCTGCCGTTTTTTGCTTG
TCGTCTGCCGTTTTTTGCTTGAAAACACACAAAATC
TCGTCTGCCGTTTTTTGCTTGGAATAAAGTCTTAGC
TCGTCTGCCGTTTTTTGCTTGTAAACATACCATCTT
TCGTCTGCCGTTTTTTGCTTGTAACTAAATAAGTAT
TCGTCTGCCGTTTTTTGCTTGTACACATT
TCGTCTGCCGTTTTTTGCTTT
TCGTCTGCCGTTTTTTGCTTT
TCGTCTGCCGTTTTTTGCTTT
TCGTCTGCCGTTTTTTGCTTTAAATATAA
TCGTCTGCCGTTTTTTGCTTTATAAA.AAAAATATA
TCGTCTGCCGTTTTTTGCTTTT
TCGTCTGCCGTTTTTTGCTTTTAAAAATAAAATTTT
TCGTCTGCCGTTTTTTGGTT
TCGTCTGCCGTTTTTTGGTTGAACAACACTACAAAA
TCTCTGAGGGTCGGT
TCTCTGAGGGTCGGT
TCTCTGAGGGTCGGT
TCTCTGAGGGTCGGTTCTTATGCCGTCTTCTGCTTT
I can do individual entry using grep as follows
grep "^TCTCTGAGGGTCGGT" file2.txt | wc -l
I need output like:
TCGTCTGCCGTTTTTT count
TCTCTGAGGGTCGGT count
I don't know how to search for multiple lines of file one in file2 and count which requires sort of loop. By the way, I did a count using perl and found sort of error in count while count using grep and want to check all entries using awk.
Thanks.