Skip to main content

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.

Brian Element Thu, 07/25/2019 - 10:08

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 Thu, 07/25/2019 - 21:53

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 Thu, 08/29/2019 - 17:08

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 Mon, 09/02/2019 - 05:23

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
 

Brian Element Thu, 09/05/2019 - 12:26

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 Fri, 09/13/2019 - 00:09

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

The website encountered an unexpected error. Try again later.