tag:blogger.com,1999:blog-5215551487816981140.post4011112742093580702..comments2024-01-23T06:10:31.184-08:00Comments on ORA-00001: Unique constraint violated: Count lines in multiple files using Windows command promptMorten Bratenhttp://www.blogger.com/profile/12300886042835631690noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-5215551487816981140.post-30555260987640774622014-07-22T09:27:25.933-07:002014-07-22T09:27:25.933-07:00^^ Results into a lock. Have to terminate the batc...^^ Results into a lock. Have to terminate the batch.dancingFridgehttps://www.blogger.com/profile/01312986313233993243noreply@blogger.comtag:blogger.com,1999:blog-5215551487816981140.post-44665816563074718192013-04-06T23:09:35.352-07:002013-04-06T23:09:35.352-07:00With help from code from Tom Lavedas at http://soc...With help from code from Tom Lavedas at http://social.technet.microsoft.com/Forums/en-US/ITCG/thread/d842e715-fbba-49ef-8863-3c944c4e60a5/, I wrote this batch file which displays both number of lines for each file and total number of lines for all files.<br /><br /><br />@echo off<br /> setlocal<br /> if not [%1]==[] pushd %1<br /> for /r %%F in (*.sql) do call :sub "%%F"<br /> echo Total lines in %Files% files: %Total%<br /> popd<br /> exit /b 0<br /> :Sub<br /> set /a Cnt=0<br /> for /f %%n in ('type %1') do set /a Cnt+=1<br /> set /a Total+=Cnt<br /> set /a Files+=1<br /> echo %1: %Cnt% lines<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5215551487816981140.post-4886321129196066552011-10-18T10:11:27.884-07:002011-10-18T10:11:27.884-07:00I like to use cygwin (a unix/linux emulator for Wi...I like to use cygwin (a unix/linux emulator for Windows) for this type of thing:<br /><br />wc *.sql <br /><br />wc -l *.txt<br />for just the number of linesAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-5215551487816981140.post-48798363498726040282011-08-08T20:34:41.590-07:002011-08-08T20:34:41.590-07:00Powershell method with grand total: Get-ChildItem ...Powershell method with grand total: Get-ChildItem *.sql | where-object {$_.name -notmatch '+'} | get-content | measure-objectJake Robinsonhttps://www.blogger.com/profile/12748751621344151762noreply@blogger.com