1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Windowsコマンドでファイル行数を数える

Last updated at Posted at 2020-12-21

1 下記ソースをloc.batとして保存する。

@echo off
if "%~1"=="" echo Usage: %~nx0 ^<SourceDirectory^> [FilenamePartern] & goto :EOF

set _fnp=%2
if "%_fnp%"=="" set _fnp=*.*

for /r %1 %%f in (%_fnp%) do (
    for /f "tokens=1-3 delims=:" %%i in ('find /c /v "" "%%f"') do (
        if "%%k"=="" echo %%f	%%j
        if not "%%k"=="" echo %%f	%%k
    )
)

2 以下、使用例になる。

loc.bat c:\java\src

loc.bat c:\apex\src |clip

以上

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?