Jump to content

Wildcards


dufran3
 Share

Recommended Posts

Is it posible to use wildcards in scripts? example

$FileRead1 = FileReadLine($FileRead,3)
    If $FileRead1 <> '*wildcard*' Then ;<----- so if $fileread1 didn't contain wildcard, it wouldn't msgBox
    MsgBox(0, "Line Read:", $FileRead1)
    EndIf
oÝ÷ Ù.z0­"g ÙèÂ+b²Z()à~ÚìZrÛ-®)à«-+)¢Ë"nW¨­©¢ë-mè§Û¦m*+¯"+y§Z×^r'^vÚÆZvÙ¨­å¡jÒÚ"¬±æ«r§§b­ú+~]z»z·jkj·!x"§b­Ëh¯'è­©ò~]z»z§)àÂ+aªê-JÖ«ªê-jëh×6
;Search
$search = FileFindFirstFile('C:\Program Files\??????\Star*.*')

I am then writing the results to a text file, each folder that it finds is on a new line, I would then like to read the file, and any line that has "star" in it, I would like to assign to a variable so I can perform an action on it.

Edited by dufran3
Link to comment
Share on other sites

from the help file: (bold mine)

FileFindFirstFile

--------------------------------------------------------------------------------

Returns a search "handle" according to file search string.

FileFindFirstFile ( "filename" )

Parameters

filename File search string. (* and ? wildcards accepted)

Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Link to comment
Share on other sites

from the help file: (bold mine)

FileFindFirstFile

--------------------------------------------------------------------------------

Returns a search "handle" according to file search string.

FileFindFirstFile ( "filename" )

Parameters

filename File search string. (* and ? wildcards accepted)

I know that wildcards are accepted in FileFindFirstFile, I have read through that. But what about FileRead? I didn't see anything about wildcards?

Link to comment
Share on other sites

I am afraid of arrays! :-(

I think that anyone is afraid of arrays the first time, but once you are good at using arrays a whole new world opens up to you.

Anyway, to your initial question.

$FileRead1 = FileReadLine($FileRead,3)
    If StringInStr($FileRead1, "wildcard") Then ;<----- so if $fileread1 didn't contain wildcard, it wouldn't msgBox
    MsgBox(0, "Line Read:", $FileRead1)
    EndIf

For example. All the String.. functions are very useful with what you are trying to do. I wouldn't bother with StringRegExp due to a personal bad encounter with the function. I found it incredibly difficult, and I still don't understand it really.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...