dufran3 Posted November 3, 2006 Share Posted November 3, 2006 (edited) 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 November 3, 2006 by dufran3 Link to comment Share on other sites More sharing options...
flyingboz Posted November 3, 2006 Share Posted November 3, 2006 from the help file: (bold mine)FileFindFirstFile --------------------------------------------------------------------------------Returns a search "handle" according to file search string.FileFindFirstFile ( "filename" ) Parametersfilename 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 More sharing options...
dufran3 Posted November 3, 2006 Author Share Posted November 3, 2006 from the help file: (bold mine)FileFindFirstFile --------------------------------------------------------------------------------Returns a search "handle" according to file search string.FileFindFirstFile ( "filename" ) Parametersfilename 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 More sharing options...
Fossil Rock Posted November 3, 2006 Share Posted November 3, 2006 Do you 'need' the text file or would writing the info to an array be better ? Agreement is not necessary - thinking for one's self is! Link to comment Share on other sites More sharing options...
dufran3 Posted November 3, 2006 Author Share Posted November 3, 2006 (edited) I would like to to both. I would like the .txt file for logging, but an array would be sweet. I am afraid of arrays! :-( Edited November 3, 2006 by dufran3 Link to comment Share on other sites More sharing options...
jvanegmond Posted November 3, 2006 Share Posted November 3, 2006 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. github.com/jvanegmond Link to comment Share on other sites More sharing options...
dufran3 Posted November 3, 2006 Author Share Posted November 3, 2006 (edited) Thanks a lot, StringInStr is exactly what I needed! Thanks! Edited November 3, 2006 by dufran3 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now