I\'m trying to extract text from a set of files on Windows using the Powershell (version 4):
PS > Select-String -AllMatches -Pattern
This worked for my situation.
Using the file: test.txt
// autogenerated by script
char VERSION[21] = "ABCDEFGHIJKLMNOPQRST";
char NUMBER[16] = "123456789012345";
Get the NUMBER and VERSION from the file.
PS C:\> Select-String -Path test.txt -Pattern 'VERSION\[\d+\]\s=\s\"(.*)\"' | %{$_.Matches.Groups[
1].value}
ABCDEFGHIJKLMNOPQRST
PS C:\> Select-String -Path test.txt -Pattern 'NUMBER\[\d+\]\s=\s\"(.*)\"' | %{$_.Matches.Groups[1
].value}
123456789012345