Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get a Folder path containing a certain str variable
#1
Hello All and thank you in advance for any help
I am trying to do a batch import of pics in a certain folder.
However the folder is generated automatically by another program which places a certain # (actually a patient's medical record number) in the title of the folder.
Inside the folder are a bunch of images.

I need to search the directory level that contains all these folders, get the path, and then insert that path into another program that performs a batch import of the images within that folder into Powerpoint.

I can do everything but search for folders using a str variable.
I have the medical record number already in a str variable called mrn

Anybody can help?
Thanks so much!!!
#2
To join strings, use str functions from or format, like this:

str number
str path

number="3456"
path.format("C:\Doc\#%s#" number)

It inserts number into path, replacing %s.


Forum Jump:


Users browsing this thread: 1 Guest(s)