Regarding Anaplan Connect Import Scripting

Deepu
Occasional Contributor

Regarding Anaplan Connect Import Scripting

Dear Team ,

 

I am using Anaplan Connect on Windows server where i need to write Script for Import/export files from Windows server to Anaplan Application .

 

My Question he as below : Let say I have 1 folder in Windows server named Import Files  where ETL jobs keep the file to load into Anaplan System . So once that file is loaded into Anaplan , We need to Moved that file from Import File Folder to Archived Folder by adding time stamp of load date and time . and post that Import File Folder get empty once file moved.

 

Ex  - Import Folder -- > GLACCT_20210224_130302.txt(post this file loaded , folder should be empty)

        Archived Folder -- >GLACCT_20210224_130302_20210225_230303.txt(folder must have files with added timestamp.)

 

Kindly do Advice on the same!

 

Warm Regards

Deepak

 

 

 

 

3 REPLIES 3
alexpavel
Certified Master Anaplanner

Re: Regarding Anaplan Connect Import Scripting

@Deepu  to achieve this you need to use Windows cmd batch commands and not Anaplan connect commands. 

there are solutions out there.. just google  "how to add a timestamp to a file in a windows batch"

 

 

 

MarkWarren
Expert

Re: Regarding Anaplan Connect Import Scripting

You can do the file move and rename in the Anaplan Connect batch file (after the import), or run a separate one after.
Here's one I created to do this:
(where you have the folders named "IMPORT" and "ARCHIVE")

 

@Echooff
for /f "delims=" %%a in ('wmic OS Get localdatetime ^| find "."') do set dt=%%a
set YYYY=%dt:~0,4%
set MM=%dt:~4,2%
set DD=%dt:~6,2%
set HH=%dt:~8,2%
set Min=%dt:~10,2%
set Sec=%dt:~12,2%

set stamp=%YYYY%%MM%%DD%_%HH%%Min%%Sec%

for /R "%CD%\IMPORT" %%f in (*.txt) do (
move /Y "%%f" "%CD%\ARCHIVE\%%~nf_%stamp%%%~xf"
)

dsoomar002
Super Contributor

Re: Regarding Anaplan Connect Import Scripting

Hello Deepu,

 

Yes as the others mentioned you can achieve moving the file from one location to another using Commands. I have seen others successfully do this utilizing Windows PowerShell. Googling tips on how to move a file using batch scripting or PowerShell queries will be your best friend as Anaplan does not offer guidance on how to perform custom scripting.