Find Text in Files and retrieve the line number

前端 未结 4 1175
悲&欢浪女
悲&欢浪女 2021-01-14 09:38

I am trying to (programatically) find references to a specific string i.e. \'LOCK_ID\' within a large number of VB6 files. To help people navigate directly to the reference

4条回答
  •  暖寄归人
    2021-01-14 09:46

    there are a number of tools to do this. I'll list them in edit as I think of them. The first to come to mind is TextPad (menu: search / search in files)

    Second tool: UEStudio.

    Both of these are paid tools. There are trials, they are quick to install, etc.

    Failing that, you could install Cygwin for some Linux style grep functionality.


    Q&A to comments

    in that case load the file in, split it on "\n", keep a counter, and do the search yourself -- probably with RegEx regular expression.

    ... there is a cool LINQ Expression here (you just need the where portion): Linq To Text Files

    Work with the directory class recursively to catch all files.

    http://www.dotnetperls.com/recursively-find-files

提交回复
热议问题