07-03-2013, 01:14 AM
Question 1
I have an array that consists of files and folders.
I want to cycle through each array item (file/folder-path) and get the following
I have tried this:
Date Pic Taken
I have windows 7 and set the corresponding "iDetails" correctly, but is there an easier/updated way to approach this using an array?
An example of an array I use
Macro Macro24
Question 2
I have a path "c:\1\2\3\4" and I have an regular expression F"^((.*?)\\){limit}" , where "limit" is an integer.
If I want "c:\1\2\" I set the 'limit' to 3, so the regex becomes likes this: ^((.*?)\\){3}
The problem is I can't get the variable "limit" included in the regex when using \Q\E sequence.
If I hardcode the "limit" whitin the regex (example: "^((.*?)\\){3}") then I get the wanted result.
I also tried the 's.escape' method but then all the curly braces get escaped.
I had an similair problem here: beginner: regex ini-like file and variable within regex but the problem now lies within the combination of the 'F-operator' and the curly braces.
Macro Macro23
I found a way around using the following method
Macro Macro23
But is there a better method to approach this?
I have an array that consists of files and folders.
I want to cycle through each array item (file/folder-path) and get the following
- Date modified
- Date created
- Date accessed
I have tried this:
Date Pic Taken
I have windows 7 and set the corresponding "iDetails" correctly, but is there an easier/updated way to approach this using an array?
An example of an array I use
Macro Macro24
ARRAY(str) arr_paths
arr_paths.create(4)
arr_paths[0]="f:\__windows_folders\_user\desk\qm_testdirs\1" ;;folder
arr_paths[1]="f:\__windows_folders\_user\desk\qm_testdirs\2" ;;folder
arr_paths[2]="f:\__windows_folders\_user\desk\qm_testdirs\3.txt" ;;textfile
arr_paths[3]="f:\__windows_folders\_user\desk\qm_testdirs\4.txt" ;;textfile
Question 2
I have a path "c:\1\2\3\4" and I have an regular expression F"^((.*?)\\){limit}" , where "limit" is an integer.
If I want "c:\1\2\" I set the 'limit' to 3, so the regex becomes likes this: ^((.*?)\\){3}
The problem is I can't get the variable "limit" included in the regex when using \Q\E sequence.
If I hardcode the "limit" whitin the regex (example: "^((.*?)\\){3}") then I get the wanted result.
I also tried the 's.escape' method but then all the curly braces get escaped.
I had an similair problem here: beginner: regex ini-like file and variable within regex but the problem now lies within the combination of the 'F-operator' and the curly braces.
Macro Macro23
int limit=3
str path_depth_rgex=F"^((.*?)\\){limit}" ;; => must add /Q and /E
;str path_depth_rgex="^((.*?)\\){3}" ;;when hardcoding the "limit" within the regex, it works
str path="f:\__windows_folders\_user\desk\qm_testdirs\abc_test_folder_6\test_subfolder_6\abc_test_subtext_6.txt"
str s
if(findrx(path path_depth_rgex 0 0 s)>=0)
,out s
;; output when limit=3:
;; f:\__windows_folders\_user\
I found a way around using the following method
Macro Macro23
str path_depth_rgex p1 p2 p3
p1="^((.*?)\\){"
p2=F"{textdir_depth}"
p3="}"
;
path_depth_rgex.from(p1 p2 p3)
But is there a better method to approach this?