Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
J

JDMils

@JDMils
About
Posts
5
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • RegEx- Find files in Linux which match the expression
    J JDMils

    Thanks K5054, that was the clincher. To find the files I need, I had to perform the following: * State the Regex Engine as 'posix-extended' * Put the expression '.*' at the start of the filename as the files are treated as fully qualified filenames (file path & filename). Thus, I can now use the following:

    find /storage/log/vmware/ -type f -regextype posix-extended -regex '.*vpxd-svcs-access-.2022-[0-9]{2}-[0-9]{2}.log.gz'

    And....

    find /storage/log/vmware/ -type f -regextype posix-extended -regex '.*sps.log.[0-9]{2}.gz'

    | +-- JDMils | +-- VB6 +-- VB Dot Net |

    Regular Expressions regex com linux tutorial

  • RegEx- Find files in Linux which match the expression
    J JDMils

    This is for my VMware vCenter servers where I am trying to clean out extra log files which are no longer required. The type of files for this example are:

    Quote:

    /storage/log/vmware/eam/web/localhost_access_log..2020-12-06.txt /storage/log/vmware/eam/web/localhost_access_log..2020-09-13.txt /storage/log/vmware/eam/web/localhost_access_log..2020-10-31.txt /storage/log/vmware/eam/web/localhost_access_log..2020-12-13.txt /storage/log/vmware/eam/web/localhost_access_log..2020-10-03.txt /storage/log/vmware/eam/web/localhost_access_log..2020-09-08.txt /storage/log/vmware/eam/web/localhost_access_log..2020-07-21.txt /storage/log/vmware/eam/web/localhost_access_log..2020-08-03.txt /storage/log/vmware/eam/web/localhost_access_log..2020-11-30.txt /storage/log/vmware/eam/web/localhost_access_log..2020-11-08.txt /storage/log/vmware/eam/web/localhost_access_log..2020-11-27.txt /storage/log/vmware/eam/web/localhost_access_log..2020-12-14.txt /storage/log/vmware/eam/web/localhost_access_log..2020-09-28.txt /storage/log/vmware/eam/web/localhost_access_log..2020-10-01.txt /storage/log/vmware/eam/web/localhost_access_log..2020-11-29.txt /storage/log/vmware/eam/web/localhost_access_log..2020-10-19.txt /storage/log/vmware/eam/web/localhost_access_log..2020-12-05.txt

    The expression which works for me in my Linux file system is this one:

    find /storage/log/vmware/ -mtime +10 -type f -name "localhost_access_log..2020-[0-9][0-9]-[0-9][0-9].txt"

    It uses the Linux "find" command to find the files, the files have to be "mtime=10" 10 days or older. I would like to shorten the regex to simplify it, and using RegExr: Learn, Build, & Test RegEx[^] as my tester, I found that the following regex works:

    localhost_access_log\.\.2020-[0-9]{2}-[0-9]{2}\.txt

    However when I try it on my Linux filesystem, it fails to produce results. I get nothing returned.

    | +-- JDMils | +-- VB6 +-- VB Dot Net |

    Regular Expressions regex com linux tutorial

  • Intercept shutdown?
    J JDMils

    The shutdown/log off action is started by the user. My app needs to detect when this happens then run an external application. Upto this point, I am OK. When the external application finishes, I need my app to continue with the shutdown/logoff. How do I detect whether the computer was originally shutting down or logging off? Another question, is once my application completes, and it issues a shutdown/log off to continue the original request (by the user) to shutdown/log off, how do I stop my app from running again!? LoL Thanks

    | +-- JDMils | +-- VB6 +-- VB Dot Net |

    Visual Basic question

  • Intercept shutdown?
    J JDMils

    I'm looking for a way to intercept the shutdown/log off of a computer to run my own app then let the computer continue to shutdown/log off. Is this possible and how?

    | +-- JDMils | +-- VB6 +-- VB Dot Net |

    Visual Basic question

  • VB.Net- Fields in Access database returned in alphabetical order
    J JDMils

    I'm using the following VB.Net code to retreive the field names of a table in an Access db: Dim NewField As ADOX.Column Dim tblField As ADOX.Column For Each tblField In adocat.Tables("tblData").Columns The fields are returned in alphabetical order! I want to have the fields returned in the order they were created. Can this be done? | +-- JDMils | +--VB6 +--VB Dot Net |

    Visual Basic database csharp question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups