The awk/ sed/ perl ones don't reflect whether any line matched the patterns in their exit status. Please beware that all those will have different regular expression syntaxes. 1 day ago &0183 &32 The giant oarfish is a deep-sea dweller that normally lives at an depth of about 700 feet but has been found as deep as 3,280 feet. Or perl: perl -ne 'print if /pattern1/ & /pattern2/' Or with sed: sed -e '/pattern1/!d' -e '/pattern2/!d' The best portable way is probably with awk as already mentioned: awk '/pattern1/ & /pattern2/' The grep command, which stands for 'global regular expression print,' is one of Linuxs most powerful and widely used commands. If your input is in sam format check XS:i: it will only be present if the SAM record is for an aligned read and more than one alignment was found for the read.If the patterns don't overlap, you may also be able to do: grep -e 'pattern1.*pattern2' -e 'pattern2.*pattern1' bash grep Subject: read-messages cut -c10-80 Re: Linux suitable for. The bit we care about is the middle of the entry, where it says 301 590. The sort INPUTFILE uniq -c sort -nr command string produces a frequency of. *s as & matches strings that match both and exactly, a&b would never match as there's no such string that can be both a and b at the same time). Your Apache logs might look differenttake a look at your LogFormat directives in your /etc/apache2/.conf files, as your LogFormat definition might mean you have to update your regex if your LogFormat is substantially different from mine. You can use samtools view -q1 my.bam to get the last one. With ast grep: grep -X '.*pattern1.*&.*pattern2.*' You can just do simple grep searches on the SAM file for lines with the XT:A:R or XA:Z: present for the first two. With GNU grep, when built with PCRE support, you can do: grep -P '^(?=.*pattern1)(?=.*pattern2)' To find the lines that match each and everyone of a list of patterns, agrep (the original one, now shipped with glimpse, not the unrelated one in the TRE regexp library) can do it with this syntax: agrep 'pattern1 pattern2' By default, under MS-DOS and MS-Windows, grep guesses the file type by looking at the contents of the first 32KB read from the file.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |