How to batch get the number of txt file lines under a folder and add them to the file name
This article introduces the "how to achieve batch processing to obtain the number of txt file lines under the folder and add to the file name" related knowledge, in the actual case of the operation process, many people will encounter such a dilemma, then let Xiaobian lead you to learn how to deal with these situations! I hope you can read it carefully and be able to achieve something!
Method 1:
@ echo off&setlocal enabledelayedexpansionfor / f "delims="% an in ('dir / a-d/b/s * .txt') do (for / f "tokens=3 delims=:"% b in (' find / c / v "% a"') do set xa%% b ren "% a"%% ~ nausen: =!% ~ xa ") pause
Method 2:
@ echo off & setlocal enabledelayedexpansion%1 (for / f "delims="% I in ('% ~ 0: ^ | sort') do ren%% I) & pause & exit / bfor / f "tokens=1,* delims="% I in ('find / c / v "" * .txt') do (set info=%%j set lncluding footrope pets! For / f "delims=" an in ("! ln!") Do set fnails infobloblol%% axioms! Echo; "! fn!"! "! FNVRU mahjong muri 4 times lnRV" 1mm. Txt ")
The method of obtaining the number of file lines by batch processing
@ echo offfor / f "tokens=2 delims=:"% an in ('find / c / v "" data.txt') do set/a result=%%a+0echo,%result%pause "how to batch get the number of txt file lines under the folder and add it to the file name" is introduced here, thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!