Apr 27, 2015

Workaround for iterations

Cycles and iterations (e.g. through a list of files) will be supported in one of the next versions of EasyMorph (expected by the end of May, 2015). Until then the following simple workaround can be used:
  1. Setup EasyMorph project so that it takes, say, input.csv and produces output.csv
  2. Generate a list of files to process in EasyMorph
  3. Iterate through this list:
    • Take one file from the list and copy it as input.csv
    • Run the EasyMorph project
    • Rename output.csv and copy it to a designated output directory

Below is an example of a batch file that does exactly this:

@echo off
setlocal EnableDelayedExpansion
SET pathEasyMorph=C:\Users\Dmitry\AppData\Local\EasyMorph\Morph.exe
SET pathInputFolder=.\
SET pathOutputFolder=.\

for /f "tokens=*" %%a in ('dir /b "%pathInputFolder%*.csv" ') do (
    copy /Y "%%a" input.csv
    %pathEasyMorph% /c /run "my project.morph"
    copy /Y output.csv "%pathOutputFolder%Processed - %%~na.csv"
    echo Processed: %%a

QlikView users may look at QlikView Integration example that utilizes the same logic using QlikView loading script.

UPDATE (6/13/2015)
This workaround is not necessary anymore. Starting from version 1.8 EasyMorph includes iterations, loops and support for multiple files.