Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
i have 3 subfolders in a directory path
C\test
in test there are folder1-prj,folder2-prj,folder3-prj
now i want to loop through these folders and run the following script
EXPRESSIONDATA:
Load
%Key_Data_7EB7522AE0A7D03B
as
ExpressionID,FilePath() as NameID
,
[ExpressionVisual/Label/v]
as
ExpressionName
,
[ExpressionData/Definition/v]
as
ExpressionCalc
,
[ExpressionVisual/Label/v]
&': ' &[ExpressionData/Definition/v]
as
Expression
,
REPLACE
(REPLACE
('$(File)','$(SubDirectory)',''),'.xml','') as
ObjectID
FROM
[$(File)] (XmlSimple
, Table
is
[GraphProperties/Expressions/ArrayOfMainExpressionData/MainExpressionData/Data]);
CHARTDATA:
Load
[ChartProperties/Title/Title/v]
as
ChartTitle
,
[Dimensions/ChartDimensionDataDef/PseudoDef/Name]
as
DimensionCalc
,
[TableProperties/ExpansionInfo/ExpansionData/Pos/DimName]
as
DimensionName
,
REPLACE
(REPLACE
('$(File)','$(SubDirectory)',''),'.xml','') as
ObjectID
FROM
[$(File)] (XmlSimple
, Table
is
[GraphProperties]);
next
left
join
(CHARTDATA) load
ObjectID
,replace
(ObjectID
, 'CH','') as
CHTID
, concat
(distinct
DimensionCalc
) as
DimensionsConcat
REsident
CHARTDATA group
by
ObjectID
;
left
join
(EXPRESSIONDATA) load
ObjectID
,
concat
(distinct
Expression
,'
' ) as
ExpressionsConcat
REsident
EXPRESSIONDATA group
by
ObjectID
;
if i run it in one of the subfolders it works well but i want to be able to loop through all the subfolders
You can find code to (recursively) loop through subdirectories here: loop through to load all files from a folder and its subfolders? You will want to replace the load code from the example with your code.
not sure what your problem is.
Why don't you use a for next statement to loop through all sub folders?
You can find code to (recursively) loop through subdirectories here: loop through to load all files from a folder and its subfolders? You will want to replace the load code from the example with your code.