﻿<?xml version="1.0" encoding="utf-8"?><XmlProjectInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Id="799b4f1e-50a7-439a-85ab-a2a5742b8b26" Name="Read Excel and CSV files in a loop" Type="0" OutputPath="build\" DefaultPublishProfile="Default" Version="2.12.3214.0" NotReplaceMacroInPreview="false" DisableMacroExtensions="false" TargitDbVersion="Version_1_281"><FileSystemObjects><IStorageInfo AssemblyQualifiedName="TARGIT.InMemory.ETL.Studio.Configuration.Xml.XmlProjectModelInfo"><XmlProjectModelInfo FileName="Read Excel and CSV files in a loop.impm" BuildAction="Yes" Id="335f758e-adf8-4dd1-be81-fe9f6e450ce7" Created="2022-09-14T08:20:10.7182979+02:00" CreatedBy="TARGIT-INET\niels_t" Edited="2022-09-14T08:21:41.2059127+02:00" EditedBy="TARGIT-INET\niels_t" IsOpened="true" CubeName="Read Excel and CSV files in a loop" PublishToServer="true" Is32BitExecutionMode="false" IsBaseScriptLocked="false" ExecuteOnScheduleOnly="false" IsStandard="false" RetryAttempts="0" RetryIntervalMins="0" RestartOnServiceFailure="true" RemoveDatabaseFromScheduler="true"><Instructions><IStorageInfo AssemblyQualifiedName="TARGIT.InMemory.ETL.Studio.Configuration.Xml.Instructions.XmlScriptInstructionInfo"><XmlScriptInstructionInfo Visibility="0" IsLocked="false" ToolSurfaceViewModelClass="TARGIT.InMemory.ETL.Studio.ViewModels.ToolSurfaces.ScriptToolSurfaceViewModel" Name="CSV and Excel import loop" Id="a012eed7-0259-4324-aa53-215f834a4c91" Query="DEBUG&#xD;&#xA;declare @count as int&#xD;&#xA;declare @filename as string&#xD;&#xA;&#xD;&#xA;/* Get handle to list files in folder */&#xD;&#xA;DATASOURCE filelistconn=DOTNET CONNECTION 'TARGIT.FileList.FileListConnection' ''&#xD;&#xA;&#xD;&#xA;/*  List all files in the csvs folder */&#xD;&#xA;IMPORT csvfiles=filelistconn.{select * from [d:\transactions\csvs] where directory='current'}&#xD;&#xA;&#xD;&#xA;/* Declare connection to CSV file so we can load CSVs */&#xD;&#xA;DATASOURCE csvLocalFile = DOTNET CONNECTION 'TARGIT.CSV.CsvConnection' ''&#xD;&#xA;&#xD;&#xA;while csvfiles.eof=false    /* Loop over all CSV files */  &#xD;&#xA;		SET @filename=csvfiles.fullpath&#xD;&#xA;		print 'Loading the file '+@filename&#xD;&#xA;		/* Import the CSV file into the table csvFolder */		&#xD;&#xA;		IMPORT csvFolder = csvLocalFile.{select * from [@@filename]}   /* Import each file into the table csvFolder  */&#xD;&#xA;		movenext csvfiles  &#xD;&#xA;LOOP&#xD;&#xA;&#xD;&#xA;IMPORT excelfiles=filelistconn.{select * from [d:\transactions\excel] where directory='current'}&#xD;&#xA;while excelfiles.eof=false    /* Loop over all CSV files */  &#xD;&#xA;		SET @filename=excelfiles.fullpath&#xD;&#xA;		print 'Loading the file '+@filename&#xD;&#xA;		DATASOURCE excelfile = DOTNET CONNECTION 'TARGIT.ADONET.Excel.ExcelConnection' 'datasource='+@filename+';'&#xD;&#xA;		IMPORT excelFolder = excelfile.{select * from [Sheet1]}  /* Import each file into the table excelFolder  */&#xD;&#xA;		CLOSE excelfile&#xD;&#xA;		movenext excelfiles&#xD;&#xA;LOOP" IsDisableMacro="false" /></IStorageInfo></Instructions><Schedules><IStorageInfo AssemblyQualifiedName="TARGIT.InMemory.ETL.Studio.Configuration.Xml.XmlSchedule"><XmlSchedule Name="Nightly update" ScheduleValue="0 0 2 1/1 * ? *" ExecutionTimeLimit="0" /></IStorageInfo></Schedules></XmlProjectModelInfo></IStorageInfo></FileSystemObjects><PublishProfiles><IStorageInfo AssemblyQualifiedName="TARGIT.InMemory.ETL.Studio.Configuration.Xml.Publish.XmlPublishProfileInfo"><XmlPublishProfileInfo Name="Default"><PublishStrategyInfo xsi:type="XmlSchedulerServicePublishStrategyInfo" Server="localhost:9098" OpenOutputFolderInWindowsExplorer="false" ExecuteAndFetchResultsLocally="false" DeleteAllExistingFiles="false" /></XmlPublishProfileInfo></IStorageInfo></PublishProfiles><DataSources /><Macros /><Synchronization IsEnabled="false" /></XmlProjectInfo>