Hello,
I have data in a txt file that looks like this:
80 E6 .. .. .. .. (Where the .. .. .. ..'s represent more byte data)
80 E8 .. .. .. ..
80 E8 .. .. .. ..
80 E6 .. .. .. ..
80 E6 .. .. .. ..
etc..
So I want to extract all data from the start value "80 E6" to the last end value of "80 E8". which would look like this:
80 E6 .. .. .. ..
80 E8 .. .. .. ..
80 E8 .. .. .. ..
No duplicates if 80 E6 is followed by another 80 E6.
When i do this:
Function Extractor{
$firstTag = '^80 E6.*$'
$secondTag = '^80 E6.*$'
$t= foreach ($line in (Get-Content C:\Users\tempFile.txt )) {
if ($line -match $firstTag) {
do {
$foreach.current
$foreach.MoveNext() > $null
}
until ($foreach.current -match $secondTag)
$foreach.current
}
}
$t | Out-file "C:\Users\tempFile.txt"
}
Extractor
Nothing happens and I dont get a return for anything execpt an empty out-file.
So is there a way so that I can only extract just those patterns of 80 E6 followed by an arbitrary number of 80 E8's? And I do not want the report to contain and 80 E6's back to back. Only 80 E6's followed by 80 E8's.
Thanks in advance!
I have data in a txt file that looks like this:
80 E6 .. .. .. .. (Where the .. .. .. ..'s represent more byte data)
80 E8 .. .. .. ..
80 E8 .. .. .. ..
80 E6 .. .. .. ..
80 E6 .. .. .. ..
etc..
So I want to extract all data from the start value "80 E6" to the last end value of "80 E8". which would look like this:
80 E6 .. .. .. ..
80 E8 .. .. .. ..
80 E8 .. .. .. ..
No duplicates if 80 E6 is followed by another 80 E6.
When i do this:
Function Extractor{
$firstTag = '^80 E6.*$'
$secondTag = '^80 E6.*$'
$t= foreach ($line in (Get-Content C:\Users\tempFile.txt )) {
if ($line -match $firstTag) {
do {
$foreach.current
$foreach.MoveNext() > $null
}
until ($foreach.current -match $secondTag)
$foreach.current
}
}
$t | Out-file "C:\Users\tempFile.txt"
}
Extractor
Nothing happens and I dont get a return for anything execpt an empty out-file.
So is there a way so that I can only extract just those patterns of 80 E6 followed by an arbitrary number of 80 E8's? And I do not want the report to contain and 80 E6's back to back. Only 80 E6's followed by 80 E8's.
Thanks in advance!