简体   繁体   中英

Android Studio: How to list files whose line count is bigger than N, e.g. N=400

I would like to get a list of files whose line count >=400. How to do that? I have tried to use search with regex options, but in vain.

Any idea on how to do this in Android Studio?

Try by installing Statistic plugin in your Android studio. So that you can view the individual and all the file information (like number of lines of code and size etc.) in one place like below.

在此处输入图片说明

The only way to read it is to read each file fully or at least until you reach the 400 lines. The second solution is better, because that way you don't always need to read the whole file, so it's faster.

To do that, you should use a buffer byte array and analyze each read character.

Using a regex for it is not always the best idea, because it's way slower, than checking each character manually.

So the regex for that will be something like this: ([^\\n]*\\n){400,}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM