none
What could be DOS version of this linux command? RRS feed

  • Question

  • HI...

    I want to store occurrence of a string in a temporary variable.

    In short , What could be the DOS version of following linux scripting.

    n=`grep -wc ${string} ${File}`

    Here we can use find command in DOS.

    But We want to store only a number in variable "n".

    We know find /c returns the number of occurrence with a string, but we want only a number.

    Wednesday, November 19, 2014 5:56 AM

Answers

  • There is no DOS command.  YOu might find some third party utilities that can do a wc on a file.

    In Powershell:

    Get-Content $file | Measure-Object -word


    ¯\_(ツ)_/¯

    Wednesday, November 19, 2014 9:48 AM