topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Sunday June 22, 2025, 10:00 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Recent Posts

Pages: prev1 ... 25 26 27 28 29 [30] 31 32 33 34 35 ... 225next
727
Most want to go the other way, Android -> SD Card, but you can try an automation app like:
Tasker (not free) - has an SD Card mount/unmounted event
Automate (free has IAPs but no ads) - has a storage mounted event

There may be others that have a suitable event which you can use to either execute a command within the app or has a plugin to allow it to control another app, (eg. file manager).
728
General Software Discussion / Re: Extract REGEX matches from multiple text files
« Last post by 4wd on August 10, 2018, 08:21 PM »
Also, I want to run sequential several regex matches with their own references, one by one and append each result to the output file.
You have to make clear whether the results from the separate queries have any positional relation to each other, or can the queries be run one after the other and the output of the second, third, etc., runs appended to the first regex run?

Or to put it another way:
  • STOP trying to describe what you want to happen, (because you're not very good at it).
  • Provide sufficient sample input data of any kind whether it's real or made up (as long as it represents the real format).
  • Provide an example of the output using the input data that shows what you're trying to achieve.
  • PROVIDE relevant feedback, something you consistently fail to do, (eg. 1, 2, 3, 4, etc, etc, etc).

DO NOT give us separate examples of two disparate data types without showing how they relate to one another, (eg. XMLw <> and CDATA []), within the same file.

Until you can do that we're just running around in circles and it's pointless continuing this thread, as such I'm out of here until the above happens.
729
General Software Discussion / Re: Extract REGEX matches from multiple text files
« Last post by 4wd on August 10, 2018, 08:38 AM »
They were to get a couple of points across, which were completely missed.

1. His guess as to why the first doesn't work will always be better than whatever we could come up with because we never, ever get enough information/context to make an informed guess/opinion.

2. He doesn't read what has already been given because the answer is in this thread.

PS. Sorry mouser ...  :-\
730
DC Website Help and Extras / Re: DC on the smallish screen
« Last post by 4wd on August 10, 2018, 06:15 AM »
I dont remember how -- and cannot see how to access the mobile site -- I'm good at missing the obvious at times, but I made a good effort here and came up with nothing...

Under the menu of Chrome there's an option Desktop site, uncheck it if it's checked - it should immediately refresh and bring up the mobile version.

If it's not checked, try another browser like Firefox Focus or Puffin and see what it shows, they all show no user panel for me unless I specifically tell them to load the Desktop site.
731
Living Room / Re: Privacy (collected references)
« Last post by 4wd on August 09, 2018, 08:04 PM »
Looks like the Ugandan government  could be in the vanguard when it comes to, uh, privacy...
 ...Uganda orders ISPs to block Ugandans from accessing Pornographic Websites   Nice one!    :Thmbsup:

Except they're 2 or 3 years behind Russia.
732
General Software Discussion / Re: Extract REGEX matches from multiple text files
« Last post by 4wd on August 09, 2018, 07:59 PM »
Any idea why this does not work?
Get-Content *.xml | Out-String

I have a better idea, you tell us why you think it doesn't work.

gc *.xml -match *regex*
does not work :(

Code: PowerShell [Select]
  1. Get-Help Get-Content

You tell us why it doesn't work.
733
DC Website Help and Extras / Re: DC on the smallish screen
« Last post by 4wd on August 09, 2018, 07:55 PM »
@tomos: What browser are you using?

Have you tried the mobile version of DC, there's no user info panel at all in landscape.

Screenshot_20180810-104945.png
734
Coding Snacks / Re: Custom WinPE build
« Last post by 4wd on August 08, 2018, 10:18 PM »
I guess that could have been taken multiple ways.  I meant I can't find the installer for x86/x64 devices.  The installers for other processors are on that page.

These seem to be the instructions: Flashing with eMMC (for Up Squared, other Intel devices)

Geared towards eMMC flashing but it has links to the image and how to create a USB version, should be able to use the info to get somewhere.
735
General Software Discussion / Re: Extract REGEX matches from multiple text files
« Last post by 4wd on August 08, 2018, 10:05 PM »
4wd did a fine job of explaining all the special chars / shortcuts ...

Hey now, that's going a bit far ...

@kalos:

Powershell Objects
The Complete Guide to Powershell Punctuation
Powershell Commands
Powershell Syntax

Every piece of script I've put in this thread resulted from one simple search - especially the last piece.

I search Google until I get close enough to the answer I want, it's how I learnt Powershell, (and I'm nowhere near being proficient in it).  If you're not getting what you want you're probably being too specific, change your search parameters, because it's a high probability that someone else has already asked it and most likely had it answered.

I suggest you read the link I posted earlier: How To Ask Questions The Smart Way

[Insert deity] knows I'm guilty of asking stupid questions but at least I try to provide all the information required/asked to help whoever it is that may decide to offer help, whether it be data, required output, the right question, cup of coffee, chocolate filled croissant, new car ... (wait, I draw the line there), etc.

And we still have no idea how your various bits of data file relate to each other.
736
General Software Discussion / Re: Extract REGEX matches from multiple text files
« Last post by 4wd on August 07, 2018, 10:05 PM »
It is not possible for anyone external to offer a complete solution because the source data cannot be shared.

And there you go, a perfect illustration of the main problem.

Despite asking for raw data several times starting from page 1, (and getting various snippets and interpretations), we find out on page 3 that the data can't be shared.

Any reason why you couldn't have told us this when it was first asked?

Also, what is | % { $_.Matches } | % { $_.Value } >> $outfile exactly?

|
A Pipe

%
ForEach-Object

$_
Object passed through pipe.

Matches
A Property of the object.

Value
A Property of the object.

You do know that they have this thing called Google, right?

Let's say I want to extract the numbers in the fields ui_mode etc or each of these three separate records.

Code: PowerShell [Select]
  1. gci *.txt | % { sls $_.Name -Pattern '^.*"ui_mode",(\d+).*$' -a | % { $_.Matches } | % { $_.Groups[1].Value } >> K:\out.txt }

Patience_Meter_Bar.jpg
737
General Software Discussion / Re: Extract REGEX matches from multiple text files
« Last post by 4wd on August 06, 2018, 04:41 PM »
Can anyone tell me please how to find a regex in a file and append it to a file? Also, how to loop that?

That is what the code I originally posted does.

Last, how to find the next regex match in the file?

Add another Select-String line with the next RegEx.

I'm going to give up until we get at least sensible raw data and what the expected output should look like ...
738
General Software Discussion / Re: Extract REGEX matches from multiple text files
« Last post by 4wd on August 06, 2018, 11:37 AM »
But I cannot make it work for my file. Any hint?

Yeah, as Ath suggested, your XML  contains CDATA so you have to read that separately.

https://stackoverflo...file-with-powershell
739
General Software Discussion / Re: Et Tu, CCleaner!
« Last post by 4wd on August 06, 2018, 07:10 AM »
Considering it has continued to try and access the net since v5.35, (Sept 2017), despite being told not to, why is this a surprise?
740
General Software Discussion / Re: Extract REGEX matches from multiple text files
« Last post by 4wd on August 06, 2018, 06:01 AM »
But I do not want to work it with Select-XML because it will limit my learning a lot.

If you are going to work with XML then learn to use the most efficient means available otherwise it isn't learning, (well obviously you'll learn from your mistakes but why be inefficient?).

The same applies to JSON, CSV, etc, etc - learning to use the wrong method to achieve what you want is what cripples you.  To put it simply: Use the right tool for the job.

From the Programmer Humor thread, a very eloquent StackOverflow answer that illustrates what Ath said about regexes above.

Do you have one of these files that is considerably less than 25GB, that contains no proprietary data, that you can 7-Zip, (being plain text with lots of repetition it should compress well), then upload to GDrive or somewhere, and then provide us with a link?
741
General Software Discussion / Re: Extract REGEX matches from multiple text files
« Last post by 4wd on August 05, 2018, 08:10 PM »
It looks suspiciously like JSON data which PowerShell can handle without using RegEx too much. My bad, wrong type of brackets.

What's the first 10-20 lines of the file?
And the last 20 or so, that'll give us enough, (in theory), to create a small test file.

If it was XML might be able to just use the Select-XML commandlet.

Why is it useless? It's exact representation apart from the fact that are more irrelevant text around.

No, it's your interpretation not the exact data, (raw data), which would show us the structure.
742
General Software Discussion / Re: Need a WinPE USB or ISO tool to load Ext HDD.
« Last post by 4wd on August 04, 2018, 07:49 PM »
Are 4Tbyte disks even supported in XP?

XP x64 for data only.
743
General Software Discussion / Re: Extract REGEX matches from multiple text files
« Last post by 4wd on August 04, 2018, 11:54 AM »
Yeah, kind of overstepped my G.A.S. limit but it provided a little mental exercise.

Normally would have left it at my first post but I was a little bored ...
744
General Software Discussion / Re: Extract REGEX matches from multiple text files
« Last post by 4wd on August 04, 2018, 07:37 AM »
Why did you leave these rather important 'details' out in your original question?

Um .... because that's what he normally does ... it always takes at least a week, (sometimes longer or never), before all pertinent information is obtained ...
745
More information on v5.4.0.0, it now has telemetry courtesy of Malwarebytes, see here.

Off the record:
The following data is sent once a day to Malwarebytes: program version, os version, os architecture (x64, x86), os language (english, german, etc), filesystem (ntfs, fat32), process run as administrator or not, computer is joined into a domain or not, machine id. No personal data is collected. These are used for statistics data to see how many users of WFC exist. Depending on the number of existing users, WFC will continue to receive new features or not. A reduced number of installations will probably stop the development of WFC, a large number will probably continue the development.

mbcut(32).dlls are used to generate a unique machine id based on os architecture. These are the same in any Malwarebytes products. Newtonsoft.Json.dll is used to create the JSON data which is sent to Malwarebytes servers.

Note: This data is sent if Windows Firewall has outbound filtering disabled (Low Filtering or No Filtering profile is used) or if there is an allow rule for wfc.exe and outbound filtering is enabled (Medium Filtering profile). In case it can't send the data if will fail silently without making nasty stuff. You can check this through Connections Log where all connections (allowed or blocked) are anyway logged. Keep in mind that if everyone will block this, it may lead to the decision of not investing anymore in WFC because there are not enough users to keep supporting it.

For those who want to stick with 5.3.1.0 it is available here, (direct link).
746
General Software Discussion / Re: Extract REGEX matches from multiple text files
« Last post by 4wd on August 03, 2018, 10:11 PM »
$items - an arbitrarily named variable
=        - sign signifying equality
Get-ChildItem

Thus $items now equals an array of files in the current folder that match *.txt
$items[0] = firstfile.txt
$items[1] = secondfile.txt
etc
etc
etc

$items.Count  - total number of matching files found

for(){}   - a for loop, $i is a variable that gets incremented by 1 every loop until the total number of matching files is reached

Thus loop through all the files in the array performing the following on every file:

Select-String -Path $items[$i] -Pattern $regex -AllMatches

Search each file for matching RegEx pattern, get all matches.

| % { $_.Matches } | % { $_.Value } >> $outfile

RegEx matches are piped into a ForEach-Object loop, (shorthand notation). For each regex match, pipe it's value to the output file in append mode.

Don't actually need to escape the " in the RegEx either:
Code: PowerShell [Select]
  1. $regex = '<dsf:tsdfgd trsdfge="urn:x-ssdfgs-dfg-com:isdfgc/tg4r3e-i4d" id="OsdfgsdfD">'
Will also work.

Same as the 6 lines above without assigned variables or a for loop:
Code: PowerShell [Select]
  1. gci *.txt | % { sls $_.Name -Pattern '<dsf:tsdfgd trsdfge="urn:x-ssdfgs-dfg-com:isdfgc/tg4r3e-i4d" id="OsdfgsdfD">' -a | % { $_.Matches } | % { $_.Value } >> K:\out.txt }
747
General Software Discussion / Re: Extract REGEX matches from multiple text files
« Last post by 4wd on August 03, 2018, 07:26 AM »
Code: PowerShell [Select]
  1. $outfile = 'K:\output.txt'
  2. $regex = '<dsf:tsdfgd trsdfge=\"urn:x-ssdfgs-dfg-com:isdfgc/tg4r3e-i4d\" id=\"OsdfgsdfD\">'
  3. $items = Get-ChildItem -Path *.txt       # *.txt , *.foo , *.whatever
  4. for ($i = 0; $i -lt $items.Count; $i++) {
  5.   Select-String -Path $items[$i] -Pattern $regex -AllMatches | % { $_.Matches } | % { $_.Value } >> $outfile
  6. }
748
General Software Discussion / Re: Extract REGEX matches from multiple text files
« Last post by 4wd on August 03, 2018, 07:14 AM »
(what are the $i = 0; $i -lt $items.Count; $i++

While i < (number of items)
  blah blah blah
  i = i + 1
Wend

EDIT: It's actually a For ... Next loop but same result.

For i = 0 to (number of items - 1) step 1
  blah blah blah
Next
749
General Software Discussion / Re: Extract REGEX matches from multiple text files
« Last post by 4wd on August 03, 2018, 05:49 AM »
Code: PowerShell [Select]
  1. $outfile = 'K:\output.txt'
  2. $regex = '^Function.+'
  3. $items = Get-ChildItem -Path *.ps1       # *.txt , *.foo , *.whatever
  4. for ($i = 0; $i -lt $items.Count; $i++) {
  5.   Select-String -Path $items[$i] -Pattern $regex -AllMatches | % { $_.Matches } | % { $_.Value } >> $outfile
  6. }
750
General Software Discussion / Re: Malwarebytes 3.0 out
« Last post by 4wd on August 03, 2018, 01:09 AM »
It appears that at some point between November 17, 2017 and now they have managed to fix the problem re. installing with an active RAM drive.

3.5.1.2522 installed without  a problem today.

Now, if I can get it to stop moaning about having Web Protection turned off ...
Pages: prev1 ... 25 26 27 28 29 [30] 31 32 33 34 35 ... 225next