Anonym 53 Posted July 14, 2019 Report Share Posted July 14, 2019 Ehum... This is kinda embarrassing... I need to find lists of files that matches wildcards. In my case I always know the prefix of the file and the extension, but the rest might differ. For instance:tesla--medium--01.jpgtesla--medium--02.jpgtesla--medium--07.jpgtesla--medium--09.jpgtesla--medium--00.jpgtesla--medium--22.jpg ford--medium--00.jpgford--big--05.jpgford--thumb--06.jpgford--big--09.jpgford--medium--10.jpgford--big--13.jpg so in one case I would want to find all tesla--medium*.jpg files in the other case I would want to find ford--big--*.jpg Previously I have solved this with regular expressions which has worked ok although a massive overkill IMO, but now when I have 48000 files I get an out of memory exception. No wonder. Can I do this in another way where I just name the filename with a wildcard and get the wanted files back as a list? Any plugin available? Thanks! Quote Link to post Share on other sites
HelloInsomnia 1103 Posted July 15, 2019 Report Share Posted July 15, 2019 Do you get the memory exception when you get the files or when you apply the regex? Without a plugin regex probably is the best way to go. If you have Elite Ubot plugin let me know and maybe I can add something in for this. Quote Link to post Share on other sites
Anonym 53 Posted July 15, 2019 Author Report Share Posted July 15, 2019 I don't have the Elite Ubot plugin. I guess I will have to get a Windows IDE and dust off my old programming skills to create a plugin that does this for me. I will release it here if I ever get there. More ppl should have use for this. (I did create a plugin a few years ago, just junk, but just to test it) Quote Link to post Share on other sites
Anonym 53 Posted July 15, 2019 Author Report Share Posted July 15, 2019 Do you get the memory exception when you get the files or when you apply the regex? Without a plugin regex probably is the best way to go. If you have Elite Ubot plugin let me know and maybe I can add something in for this. Seems like a good plugin. No idea if it searches for files, but are you saying that you could add it with wildcard search too? I mean, a function that returns a list of files that matches a certain wildcard and/or Ubot variables. Is that the idea? Quote Link to post Share on other sites
HelloInsomnia 1103 Posted July 16, 2019 Report Share Posted July 16, 2019 I was asking because doing this is really simple and I knew I could just throw it in there if you had that plugin. But if you want to make your own here is some code that shows you how to do it: static void Main(string[] args) { string directory = ""; // path to the folder you want to search in string searchPattern = "tesla--*--*.jpg"; string[] files = Directory.GetFiles(directory, searchPattern, SearchOption.AllDirectories); foreach (var file in files) { Console.WriteLine(file); } Console.ReadLine(); } Quote Link to post Share on other sites
Anonym 53 Posted July 16, 2019 Author Report Share Posted July 16, 2019 Yep, the windows call is simple. Now I "just" need to get the UBotPlugin interfaces right. I have purchased your plugin instead and saved myself some work.I hope that it still works with UBS 5. (I can't use UBS 6 due to this:http://network.ubotstudio.com/forum/index.php/topic/22502-is-60-good-now/?do=findComment&comment=137919) Pls let me know when it's done. Quote Link to post Share on other sites
HelloInsomnia 1103 Posted July 16, 2019 Report Share Posted July 16, 2019 Yep, the windows call is simple. Now I "just" need to get the UBotPlugin interfaces right. I have purchased your plugin instead and saved myself some work. I hope that it still works with UBS 5. (I can't use UBS 6 due to this:http://network.ubotstudio.com/forum/index.php/topic/22502-is-60-good-now/?do=findComment&comment=137919) Pls let me know when it's done. It's finished, you can download the update by logging in here: https://elitebotters.com/my-account/ Quote Link to post Share on other sites
Anonym 53 Posted July 17, 2019 Author Report Share Posted July 17, 2019 Thanks! Quote Link to post Share on other sites
Anonym 53 Posted July 17, 2019 Author Report Share Posted July 17, 2019 Please check your PM Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.