How To Import Automatically data Contain certain Date

11 posts / 0 new
Last post
mobbie
Offline
Joined: 11/09/2015 - 05:06
How To Import Automatically data Contain certain Date

Helo,
Could someone help me with this case. I have file name that contain date format.  Could anyone help me with scripts that can  import automatically based on now date and one/two/three days before.
 
Thank you for your help.

Images: 
Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Hi mobbie,

I am not quite following what you want.  I see text files with different dates, do you want to import all 4 files at the same time.  Do they all have the same record definition?

Brian

mobbie
Offline
Joined: 11/09/2015 - 05:06

Halo Brian,
Yes Brian, I want to import all 4 files at the same time. And create script that can import file with now date (date based on server date).
 
Thank you

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Are all the files in the same format?

mobbie
Offline
Joined: 11/09/2015 - 05:06

Sorry for the late respon, Yes Brian. All the files in the same format.
 

mobbie
Offline
Joined: 11/09/2015 - 05:06

Hello, Does anyone can help me?

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Hi mobbie,

Sorry it has been a busy few weeks.  I have put together a small script for you.  It will first ask you for the location of your text folders, they have to be in a folder within your project.  It will then ask for a record definition for these files, they all have to be of the same type.  It then imports each one and adds on the date to them.  Try it out and hopefully it fits your needs.

Brian

mobbie
Offline
Joined: 11/09/2015 - 05:06

Hi Brian,
Thank you for your help, but i have an error issue, it says "Error on line 30 : Not enough Memory". Could you help me with this problem?
Btw, can I change the import definitons from .RDF to .JPM? because I'm using .JPM. And, for the import definition for each file is different. For example: I use fileA.JPM for CFPD0200.txt and fileB.JPM for DEP001H2.txt.
Thank you for your help Brian.
Mobbie
 

Images: 
Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Hi mobbie,

That error could be because of using the ASCII definitions name, use you should change RDF for JPM in the file.

The problem with using different import definitions with different files is being able to map which definition to use, that is why when I usually do these scripts I assume all the files use the same definition.  In your case you would have to come up with some way to map the file to the definition, once you come up with that then you would have to adapt the script to figure out when you are import file ABC you are using defintion ABC.JPM and not CBA.JPM.

Brian

mobbie
Offline
Joined: 11/09/2015 - 05:06

Halo Brian,
Sorry for the late response. I can't use .RDF, because the contents of my file are like this (attached picture), where the file can be translated using only .JPM. Can you help me with this?
Mobbie

Images: 
mobbie
Offline
Joined: 11/09/2015 - 05:06

Halo Brian,
Actually, my problem is similiar with this forum https://www.ideascripting.com/forum/automate-daily-file-import, but I'm using IDEA Desktop and my file is .TXT with Import Assistant using Print Report and Adobe PDF (.JPM).
Could you help me with this Brian?
Thank you very much