Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.
hi,Am having a file with 1 line having a file size of 35MB.Eg:- arun*America*MSC~INS*dfffs*Sdfsd*sdfsd~ssfsd*sdfsd~INS*dfffs*sdfsdf*sdfs~I need to get a count of INS* in the above file. Am new to DOS Commands. Please help me.Thanks in Advance.Regards,Arun S.
c:\test> gawk "{m=gsub("INS",""); total+=m}END{print "total:" total}" file
c:\test> gawk "{m=gsub(\"INS\",\"\"); total+=m}END{print \"total:\" total}" file
hi,Thanks It works.. but please let me know if we can do it in Find Command.... Regards,Arun S.
Const ForReading = 1Set fso = CreateObject("Scripting.FileSystemObject")Do WScript.StdOut.Write "Please enter file name: " strFile = WScript.StdIn.ReadLine If fso.FileExists(strFile) Then Set objFile = fso.OpenTextFile(strFile, ForReading) strCharacters = objFile.ReadAll Exit Do Else WScript.StdOut.Write "Invalid file name ... Try Again" & vbCrLf End IfLoopDo WScript.StdOut.Write "Please enter character string: " strToCount = WScript.StdIn.ReadLine If strToCount <> "" Then Exit Do LoopstrTemp = Replace(LCase(strCharacters), LCase(strToCount), "") WScript.Echo "Occurences of:", strToCount, "=", (Len(strCharacters) - Len(strTemp)) / Len(strToCount) objFile.Close
set /p pass=<string.txtecho %pass%:stcall set new=%%pass:~%a%,1%%echo a=%a% + 1echo %a%set key=%key%%new%echo %new%echo %key%pause::if %new% ==; goto :EOFpausegoto :st