The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
29 views

Use findstr to output characters 1-13

I have the code: findstr /B ^121.*.CATDrawing catdrawing.txt How to show from the first to thirteenth character? 1220112000001A.CATDrawing -> 1220112000001
0
votes
2answers
19 views

Windows 7 cmd Findstr for 2 strings a AND b(not OR)

I want to know if there is a way to use findstr to find only those lines in a text file which have both strings a and b. The following: findstr "aaa bbb" test.txt will find all lines with aaa or bbb. ...
0
votes
0answers
63 views

Find and delete characters special in text file batch file

Example: three text files: 1.txt contents store is: 7.1M 2.txt is 72M 3.txt is 7.21M I would use batch file to scan these three text files and output: 1.txt is 7 2.txt is 72 3.txt is 7 Thank ...
0
votes
1answer
50 views

Batch to retrieve TFS version erroring in FOR /F where TFS attempts to PIPE to findstr

I have this partial batch, but it gives me an error (On 64 bit installations) SETLOCAL EnableDelayedExpansion REM Figure out what ProgramFiles Root we run the command SET ...
0
votes
2answers
85 views

Getting value from file using Windows Batch scripting

Using Windows Batch scripting, I want to get the max_volume value (-2.9 in the following example) from a ffmpeg output written to a log file: [Parsed_volumedetect_0 @ 0000000005428b20] n_samples: ...
0
votes
0answers
19 views

Findstr sometimes returns big blocks of text?

When using findstr to search through files, I usually get results that show snippets containing the search term. Occasionally though, I get big blocks of text instead of just a single line snippet, ...
1
vote
1answer
65 views

What is the difference between regular and literal expressions in FINDSTR?

What is the difference between /R and /C? FINDSTR [options] [/F:file] [/C:string] [/G:file] [/D:DirList] [/A:color] [/OFF[LINE]] [string(s)] [pathname(s)] /C:string Use string as a literal ...
0
votes
0answers
22 views

findstr prints help instead of result

I have tried these commands, all of which should return a result of some sort from my test file. Insead of getting an actual result, I'm getting a long list of instructions on how to use findstr. ...
0
votes
1answer
937 views

Script to Find Certain words and delete those lines in a file

EDITED THE QUESTION as i am open to different type of solutions unlike just batch previously I am on Windows & some suggested SED etc. So i am OK with these 3rd party standalone exe's using ...
2
votes
3answers
455 views

In windows, is there a way to count the amount of times a string appears in a file

I am currently trying to write a batch script and at this point, I need to find a string, "null", and determine how many times it is shown in the file. I'm downloading an API from a website ...
0
votes
0answers
542 views

How to find which port a service is using by “grep” the result of netstat output on windows 7?

i want to find which port a service is using. i know i can use netstat -anb to show all the protocols and all applications. but how can i filter the result, eg. if the program i'm trying to ...
1
vote
1answer
195 views

Dir and Findstr commands taking a long time to complete in Batch File

dir %DRIVE_NAME%: /S /C /A-D /Q /T:C | findstr ".zip$ .doc$ .xls$ .xpt$ .cpt$ .cpo$ .xlsx$ .pdf$ .dat$ .txt$ .docx$ .csv$" >> file.info I am using above command to list all information in ...
2
votes
2answers
2k views

Use Batch findstr for files with whitespaces

I'm trying to search for a string in a given file. This file can have whitespaces in its name and I'm having trouble with the Batch file. I can easily do this by console getting the correct results: ...
4
votes
1answer
466 views

Vim: How do you use external grep on windows to search for quotation marks?

For some reason I can't for the life of me figure out how to pass single quotation marks to external tools when using vim. For example, I might want to call Vim's external grep to search for the text ...
1
vote
1answer
194 views

Batch : extract some characters of a string

How can I extract alphanumeric characters only from a string? Example : b:lbalbqsd1287/;:!, gives blbalbqsd1287 Is it possible with findstr?
0
votes
1answer
668 views

Searching a string in a file anywhere on PC using Findstr

I have a text (.txt) file located somewhere on my PC that contains a bunch of data, including the following string: Secret Username: ********* Secret Password: ********* How can I find this file ...
1
vote
2answers
2k views

Why does this 'findstr' command not function as expected?

I use the command-line program 'findstr' frequently as I write software. It helps me quickly locate all the files that contain a specific string in a set of subdirectories. It is a lot faster to use ...
0
votes
3answers
495 views

Recursive Batch File

I have a file that looks this: head1,head2,head3,head4,head5,head6 a11,a12,keyA,a14,a15,a16 a21,a22,keyB,a24,a25 a31,a32,keyC,a34 a41,a42,keyB,a44,a44 a51,a52,keyA,a54,a55,a56 ...
1
vote
0answers
629 views

Find vs Findstr results

Per this answer I was attempting to use findstr to locate a string (a name) inside some HL7 log files in a directory. Findstr was getting 0 results, but Find returned plenty. I played around with ...
0
votes
1answer
4k views

How to get the exact match of a string in file using FIND or FINDSTR in dos

I am trying to get the exact match of a path ("\Users\sachin.a.goyal\Desktop\test\") which is there in a file: Biggest.txt: 1 number: name = DMS 3.0 R2 - Deployment Workbook_APAC v4_WMT size = ...
11
votes
3answers
20k views

What's the difference between the find and findstr commands in Windows?

In Windows, what are the differences between the find and findstr commands? Both seem to search for text in files: find C:\> find /? Searches for a text string in a file or files. FIND [/V] ...