Search Results

Search: Posts Made By: patdoor
6,249
Posted By ygemici
# cat file ABCDDEBFGFDDSD BBBBZYZWWDILSAASAA ...
# cat file
ABCDDEBFGFDDSD
BBBBZYZWWDILSAASAA
BBBBZYZWWDILSAASAA

try search "B" ...
# sed 's/[^B]//g' file|sed ':a;$!N;s/\n//;ta'|sed -e 's/B/&\n/g'|sed -ne '/^$/!p'|sed -n '$='
10
# awk...
6,249
Posted By joeyg
Not much time, but perhaps a start...
$ cat sample1.txt
ABCDEFAB ASK SDFKJDF

$ cat sample1.txt | sed s/./\&~/g | tr "~" "\n" | grep "B" | wc -l
2
6,249
Posted By bartus11
Try this in directory containing those thousands...
Try this in directory containing those thousands of files: perl -n0e '@n=/B/g;print "$ARGV ",$#n+1,"\n"' * | sort -rnk2 > result
Showing results 1 to 3 of 3

 
All times are GMT -4. The time now is 09:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy