linux - How to obtain a certain field information in the same type of file under different paths in the shell?
巴扎黑
巴扎黑 2017-07-04 13:45:17
0
1
896

Under the A path, there are folders with different file names such as 1A, 2B, 3C, 4D, 5E, etc. Under these folders, there is a Data folder. The Data folder generates daily folder paths according to time. . There are files of .txt type under these lowest paths (but not only files of this type).
Now I want to write a script under the A path. Its purpose is to get the data after the count field in the file from the txt type file under the bottom path. This value always appears in the file as a string like this: "count:XX"
For example:
A/1A/data/20170630/asd.txt
A/1A/data/20170630/ zxc.txt
A/2B/data/20170630/dfg.txt
A/2B/data/20170630/dnv.txt
I need to get the numerical value after count in these txt files.

巴扎黑
巴扎黑

reply all(1)
洪涛
grep -rPo '(?<=count:)\S+' *
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!