Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tech Request -- Accessing extensionless files from VBA
 
#12
Does VBA have support for regular expressions? Hmm, quick web search suggests RE was added around 2002 or so. If yours is new enough, then what we need is an RE that searches for filenames that end with "."
If I am reading things right then the RE filter you want is: .$
The slash changes the period from representing its default 'any single character' to searching for an actual period, and the dollar sign says the match must come at the end of the string being examined.
Doing a quick Google search I found what may be a relevant page on Stack Overflow. Unfortunately I don't have an MS Office new enough to support RE on any of the computers at home, so I can't test what they're showing (desktop is still loaded with Office 97, of which Excel is acting up). But one of the answers looks at going through a file list and the last one gives a snippet of code for applying a RE filter. Only thing I could test it on right now would be Java (and by coincidence, this week's assigned chapter in my class is on File I/O).
And, as we have now invoked regular expressions we must of course link to the relevant XKCD: Everybody stand back! I know regular expressions!
-----

Will the transhumanist future have catgirls? Does Japan still exist? Well, there is your answer.
Reply


Messages In This Thread
[No subject] - by jpub - 07-23-2010, 07:31 PM
[No subject] - by SkyeFire - 07-23-2010, 09:17 PM
[No subject] - by paladindythe - 07-24-2010, 12:35 AM
[No subject] - by Ankhani - 07-24-2010, 01:26 AM
[No subject] - by SkyeFire - 07-24-2010, 03:03 AM
[No subject] - by Kurisu - 07-24-2010, 09:23 AM
[No subject] - by Ankhani - 07-24-2010, 08:17 PM
[No subject] - by CattyNebulart - 07-25-2010, 05:01 AM
[No subject] - by Sofaspud - 07-25-2010, 08:03 AM
[No subject] - by SkyeFire - 07-25-2010, 04:44 PM
[No subject] - by LilFluff - 07-25-2010, 10:44 PM
[No subject] - by Sofaspud - 07-26-2010, 03:16 AM

Forum Jump:


Users browsing this thread: 4 Guest(s)