Automated script to load files

Hi ,
i have a procudure (pl/Sql) that loads a dat files to oracle tables, taking a file name as input parameter.
i manually execute this pl/sql on daily basis which usually takes 30 min for one file.
but now due to some issue in data i will have to truncate all the tables this procudes load as reload the data,there are nearly 100 files which i have to run,
the files should be processed one after the other in a order.
can any one suggest how can i automate this process.
i just wanna load 10 files at a time.
Meaning, a script to supply files names to this pl/sql and return the log
thanks.

simply use a date instead of a number.
  SQL> begin
    2    for i in ( select dt from ( select sysdate+level dt from dual
    3                  connect by level <= 10 ) ) loop
    4      dbms_output.put_line(to_char(i.dt,'ddmmyyyy')||'_DSW');
    5    end loop;
    6  end;
    7  /
  13052008_DSW
  14052008_DSW
  15052008_DSW
  16052008_DSW
  17052008_DSW
  18052008_DSW
  19052008_DSW
  20052008_DSW
  21052008_DSW
  22052008_DSW
  PL/SQL procedure successfully completed.
  SQL>
in your case you need to identify what is the starting date. replace the sysdate with that starting date and the level identifier from 10 to 100. assuming that in your given example it starts at 05062007.
  begin
    for i in ( select dt from ( select to_date('05-JUN-2007','dd-mon-yyyy')+level dt from dual
                  connect by level <= 100 ) ) loop
      dbms_output.put_line(to_char(i.dt,'ddmmyyyy')||'_DSW');
      procedure_load_file(to_char(i.dt,'ddmmyyyy')||'_DSW');
    end loop;
  end;

Similar Messages

  • Trigger automator script when new file created

    I want to create an automator script that will recognise when a new file is created (with a name that matches a particular pattern and in a certain directory) and mail that file to a predefined address. Is that possible?

    yes, this is possible with a folder action. you can attach a folder action to the folder in question. it will watch this folder for new files and trigger when a new file is added. you can create an automator workflow and save it as a folder action plugin.

  • Automator Script to rename files with the file's Comment text?

    Hello and thank you for your time!
    Summary:
    I'd like to have an Automator Script that would copy the File's Comment info and paste it to the File's name, so I can import my sound effects into iTunes and have the proper labeling.
    Breakdown:
    I have a ton of Sound Effects that I'd like to put into iTunes, but the filenames are for example, "04. Track 04.mp3".  Not the most helpful name.
    I can search by "car crash" in the finder and find THAT file ("04. Track...")  because it's in the File's metadata in the Comment info, as "Car Crash - Chevy Camaro".
    So is there a script or a way to script Automator to copy the File's Comment info and paste it to the File's name, so I can import these into iTunes and have the proper labeling?
    Thank you for reading!
    - Ben

    This should be much faster and direct....
    Source = "C:\temp" 
    Destination "C:\newTemp"
    Set objFSO = CreateObject("Scripting.FileSystemObject")     
    Set arrFiles = objFSO.GetFolder(Source).Files  
    For Each file In arrFiles  
        If InStr(LCase(file.name), ".zip.") > 0 Then 
            arrFilename = Split(lcase(file.name), ".zip.")  
            newname = arrFilename(0) & ".zip" 
            WScript.Echo file.name & " -> " & newname  
            objFSO.CopyFile file.path, Destination & "\" & newname
        End If 
    Next 

  • My Automator script to backup files to encrypted disk image

    Hi there. I have a question regarding Automator and Encrypted disk images. I've put together a workflow that grabs files in my home folder. My home folder is utilizing FileVault. I'm grabbing things like my iphoto library, documents folder and such. On an external usb drive I've created an encrypted disk image about 100GB. My goal is for the automator action to "successfully" mount > copy > unmount the encrypted image.
    As of right now, the script works, but gives an error at the end of the copy, not allowing a successful unmount of the dmg. Is there something I'm doing wrong? I browsed through all the files after copying and they are all there, the folder sizes match up 100%.
    I guess I could just use a program that does this, but, I find it much easier clicking on a shortcut in my dock to run the script and go away for 10 - 15 mins.
    If it would help to view the script, let me know and we'll work something out.
    Thanks

    The popup box says:
    The action "Copy Finder Items" encountered an error. Check the action's properties and try running the workflow again.
    And the Automator workflow log says:
    Can't read directory contents: /Volumes/Backup
    But as I said, clearly it works and reads/writes to the encrypted dmg because all the files are there. What I do is just select all the folders inside the drive first, and delete/empty the trash first before running the action. This is the second step once I know this is working. So that I don't have to manually delete them everytime before running the script.
    So to answer your question, the drive is empty, and the dmg is empty, allowable for a maximum 100GB of storage.
    I think it might be something to do with copying files to an encrypted disk image, but, I can't find any help anywhere on this.
    Thanks

  • Modify Load Files into Stack.jsx

    I am new to Photoshop Scripting so I am sorry if this has already been answered, but I can't seem to find out the answer or figure this one out.   I am writing a script that is doing an INCLUDE using the Photoshop script Load Files into Stack.jsx.  This script seems to name the layers the Filename.  I would like to figure out how to modify this script to not include the file name in the layer and just put Layer 1, Layer 2.  Any help would be greatly appreciated. 

    That may work, but I am not sure what to put into the script and where (sorry, yes I am new at this, this is my first attempt and Photoshop scripts).  Here is what I am doing and what I have coded so far.  I have created a droplet that would move files over into Photoshop do some reformating of the images and then when I get 4 images into Photoshop I am merging the open documents into a separt document and then kicking it back over to an action to do some more formatting with the combined document.  Here is the code I have so far. 
    var loadLayersFromScript = true;
    //@includepath "/C/Program Files/Adobe/Adobe Photoshop CS5.1 (64 Bit)/Presets/Scripts/"
    //@include "Load Files into Stack.jsx"
    var files = [];
    // declare local variables for close files
    var name = activeDocument.name;
    for(var d =0;d<app.documents.length;d++){
        try{
            files.push(app.documents[d].fullName.fsName);
        }catch(e){
            alert(localize('$$$/AdobePlugin/Exposuremerge/Mustsave=Documents must be saved before they can be merged'));
    if( d > 3 ){
    loadLayers.intoStack(files,true);
    // close documents except Untitled document
    while (documents.length > 1) {
      for (var i = 0; i < documents.length; i++) {
    // close all documents except the active document
      if  (documents[i].name != "Untitled1") {
                  documents[i].close(SaveOptions.DONOTSAVECHANGES);
    doAction("Resize Canvas", "Finish Document");
    The reason I need the Layers to not be names is because the document names change and I can not get the actions to work with the differences in the Layer Names when the new files come in. 
    Any help would be GREATLY appreciated.   

  • Release Management vNext Powershell Could not load file or assembly System.Management.Automation Version=3.0.0.0

    Hi,
    I'm running TFS2013.4 with a number of build servers and all working fine. 
    I'm also running Release Management with update 4 (12.0.31101.0) and am running into trouble when trying to run my first dummy release.
    I have setup my servers, stages, releases paths, components and release template (all vNext) with out issue.
    When I run my Release Template (Deploy Using PS/DSC) I'm getting the following error :-
    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AggregateException: One or more errors occurred. ---> System.IO.FileNotFoundException:
    Could not load file or assembly 'System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
    The system cannot find the file specified.
       at Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment.PowershellExecutor.DisposeCurrentSession()
       at Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment.RemoteDeploymentHelper.Dispose()
       at Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment.DeploymentClient.<RunAsync>d__11.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment.DeploymentClient.<RunPowerShellAsync>d__1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.TeamFoundation.Release.EnvironmentProvider.OnPrem.Implementation.OnPremDeploymentProvider.<CopyBuildsLocally>d__5.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.TeamFoundation.Release.EnvironmentProvider.OnPrem.Implementation.OnPremDeploymentProvider.<RunScript>d__0.MoveNext()
       --- End of inner exception stack trace ---
       at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
       at Microsoft.TeamFoundation.Release.MonitorServices.Dsc.OnPrem.OnPremDeploymentActions.InvokePlatform(String activityId, MachineSpecification machineSpecification, StorageSpecification storageSpecification, String scriptPath, String configurationPath,
    Dictionary`2 configurationVariables)
       at Microsoft.TeamFoundation.Release.MonitorServices.Dsc.OnPrem.OnPremDeploymentActions.RunScript(DscComponent dscComponentParameters, String serverName, String userName, String password, String componentName, String scriptPath, String configurationPath,
    String useCredSecuritySupportProvider, String useHttps, String skipCACheck)
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
       at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at Microsoft.TeamFoundation.Release.DeploymentAgent.Services.Deployer.Dsc.DscComponentInstaller.InvokeMethodByReflection(String methodArguments)
    I can't work out if my target machine (2008 R2 SP1) has a problem with WMA 3.0 or if the Release Template can't find the powershell script that I'm trying to call.  I figured that the relative path to the script could be wrong and have tried numerous
    iterations to no effect.  The error clearly points to a problem with WMA right?
    The target machine has .Net Framework 4.0, WMA Framework 3.0 and I can run Enter-PSSession to remote to it etc...
    Before I trash and rebuild my target machine I hoping someone may have some insight to my problem?
    Thanks in Advance
    Jason
    shroomie

    Daniel,
    The PS Script is taken from an MSDN blog and is fairly standard.  I'm sure it will run fine when executed, but I've not run it as it requires environment variables ($applicationPath) that will be present in the Release Management session calling it. 
    Here's the script :-
    configuration InstallModules
        param
            # Target nodes to apply the configuration
            [string[]]$NodeName = 'localhost',
            # Source Path for Modules
            [String]$SourcePath = "$applicationPath\Deploy\Modules",
            # Destination path for Modules
            [String]$DestinationPath = "$env:ProgramFiles\WindowsPowershell\Modules"
        Node $NodeName
            # Copy the Modules
            File ModuleContent
                Ensure          = "Present"
                SourcePath      = $SourcePath
                DestinationPath = $DestinationPath
                Recurse         = $true
                Type            = "Directory"
    InstallModules
    Thanks
    Jason
    shroomie

  • Looping in Maxl Script - To load multiple files

    Hi,
    I am using Essbase 11.1.2 on UNIX.
    I have maxl script which will load 20 to 30 extraction file. Number is inconsistent. Extraction files will grow each month. Extraction files are with same name with the suffix _1,_2...(2 Gb thing). My previous script was hard coded to load file by file to load up to 50 files. I am trying to remove these hard coded lines, and try to loop the “load” statement. I have tried several ways using while loop in shell to call maxl /msh , but no luck. Any ideas?
    Thanks

    A very similar question was asked recently (but for Windows): Re: Maxl to import datafolders
    What have you tried? Maybe someone here can show you what's wrong with your script.
    The approach I usually take with this type of problem is to write a script that dynamically builds one single MaxL script with the appropriate number of files, rather than calling MaxL multiple times.
    I am generally too ashamed to share my Unix scripts, but at it's most basic, non-error-trapped, probably-inadvisable-and-full-of-holes-for-all-kinds-of-reasons, you could include something like this to build your load script:
    ls filename*.txt | awk {'print "import database etc... "$1" ...on error etc;"'} > scriptname.mshSince you can nest MaxL scripts, you can then reference scriptname.msh from a static 'master' script which handles login / spool on / spool off / logout as appropriate. See http://download.oracle.com/docs/cd/E17236_01/epm.1112/esb_tech_ref/maxl_commands_nesting.html or Cameron's 2009 K'scope presentation: http://odtug.com/apex/f?p=500:575:526121996615242::NO::P575_CONTENT_ID:4605

  • Require script to load fixed  length flat file

    Hi
    Can anyone provide me a script to load a flat file into database ? A sample script would be ok
    thanks in advance
    Siva

    You can use SQL*Loader to do this, or external tables in 9i or higher. These methods are well-documented in the Utilities Guide.
    Cheers, APC

  • Automator Script - How to Batch Convert PDF files to max 200x200px JPG Files

    I have tried several different Automator scripts and can't seem to get it right.
    Each day I have 25 different PDF files. I need to convert the first page of each PDF file to a max width and height of 200x200px jpg file (not jpeg).
    In automator, how do you do a batch convert of the first page of PDF files to a max width and height of 200x200 JPG files?
    Thanks!

    Try
    GraphicsMagick.

  • Jquery slider is not consistently loads while running coded ui automation script

    Hello Guys,<o:p></o:p>
    I am doing coded ui automation testing for mvc application. Now there are some features where we are loading Jquery slider from left towards right. Actually those slider loads properly
    when users does it manually but when i ran it using coded ui script, so sometimes slider comes and go back within seconds .This means it is not loading properly but sometime its load fine.so due to that coded ui does not find respective control to click over.<o:p></o:p>
                I have tried to wait with different option of playback , wait , delay but the behavior is still same.
    That means my test fails to load proper slider window  most of the time.<o:p></o:p>
    Can anyone suggests me some inclinations to solve this problem. <o:p></o:p>
    Thanks in advance.<o:p></o:p>

    Actually i have tried to wait in all possible ways provided by coded ui . But issue happens only sometime during following scenario:
    1. I click on "x" button 
    2. Then that slider gets loaded from right towards left. There is again other internal ajax call which brings up data to show on slider. For that i have used webwaitforcontrolready=3 to disable ajax or js engine. 
    3. But sometimes problem occurs when automation scripts clicks on "x" button ,then slider comes and go back within fraction of seconds. I do not know whether it is due to network speed or any other issue. so due to that subsequent action on that slider are
    not getting executed or gets failed.
    could you please suggests me which wait should i use till that slider loads completely and then only move to next action?
    i have tried using wait(), thread sleep(),waitforcontrolready(),waitforcontrolexits(),waitforcontrolenabled(),playback.settings.waitforreadylevel=allthreads.

  • SQLLDR script to load .xls file to database.

    Hello Experts,
    Please can anyone tell me the sqlldr script to load .xls file to the database.
    I am using Oracle 10g XE as the database, and want to load a .xls file to a schema using the sqlldr script.
    Waiting for your reply...
    Thanks in advance,
    Manoj Indalkar.

    Hello Manu,
    that's what heterogeneous services are made for. With these you can select from XLS files.
    Re: Read CSV/XLS file to insert into Oracle database.
    or
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:4406709207206
    http://jiri.wordpress.com/2010/01/21/load-ms-excel-file-to-oracle-database/
    Regards
    Marcus

  • Problem in uploading attachment files through automation scripts using Oracle Application Testing Suite(OATS)

    I am using OATS tool for writing automation scripts to test a web-based application . But I am facing problem when the requirement is to upload any file from the system to that web application .
    Actually the behavior of the script or I guess of OATS is inconsistent as the attachment file is getting upload sometime and
    fails to do so at the other time .
    I have observed a strange case also ,i.e whenever i am executing the scripts while sharing my system screen on webex meeting
    then the attachment upload results in failure . What can be the proper solution for doing file upload using automation script ??

    Can you please check whether the sync has been taken care before performing the upload operation. If the sync is taken care then the upload should work always

  • Writing commands to get specific data channels in the output report via script or automated script generation..

    In my project I have to make certain calculation and then get the data plotted in the given report template. I am using automated script for this. My script is doing all the calculations and then it not selecting and drag-dropping the selected channels on the report template. Its saving the blank report template.
    I am struggling to get the data for specific channels plotted by using the script. I need the selected channels to be plotted on this report template and then get it saved.
    Any help will be deeply appreciated. Thanks
    Solved!
    Go to Solution.

    Hi LaxG,
    Brad is absolute right. It is possible to create your whole layout via script.
    If you have loaded  the example report layout you can copy these lines to create a new line in your plot. This is the recommended object oriented way.
    call Report.Sheets("Blatt 1").Objects("2D-Axis1").Curves2D.Add(e2DShapeLine, "anyName")
    Report.Sheets("Blatt 1").Objects("2D-Axis1").Curves2D.Item("anyName").Shape.XChannel.Reference               = "[1]/Zeit"
    Report.Sheets("Blatt 1").Objects("2D-Axis1").Curves2D.Item("anyName").Shape.YChannel.Reference               = "[1]/Geschwindigkeit"
    For performance reasons it's recommended to use the it like this.
    dim oLine
    set oLine = Report.Sheets("Blatt 1").Objects("2D-Axis1").Curves2D.Item("anyName").Shape
    oLine.XChannel.Reference               = "[1]/Zeit"
    oLine.YChannel.Reference               = "[1]/Geschwindigkeit"
    Like Brad mentioned it is much easier, that you have a stored template of your report with all setings and customisations already done.
    You open this layout file and have stored the names of your calculated channels. When you are doing this with a script they always have the same name and belong to the same group.
    Now you can customize the references of the line items.
    Kind Regards,
    Philipp K.
    AE | NI Germany

  • How to automate the data load process using data load file & task Scheduler

    Hi,
    I am doing Automated Process to load the data in Hyperion Planning application with the help of data_Load.bat file & Task Scheduler.
    I have created Data_Load.bat file but rest of the process i am unable complete.
    So could you help me , how to automate the data load process using Data_load.bat file & task Scheduler or what are the rest of the file is require to achieve this.
    Thanks

    To follow up on your question are you using the maxl scripts for the dataload?
    If so I have seen and issue within the batch (ex: load_data.bat) that if you do not have the full maxl script path with a batch when running it through event task scheduler the task will work but the log and/ or error file will not be created. Meaning the batch claims it ran from the task scheduler although it didn't do what you needed it to.
    If you are using maxl use this as the batch
    "essmsh C:\data\DataLoad.mxl" Or you can also use the full path for the maxl either way works. The only reason I would think that the maxl may then not work is if you do not have the batch updated to call on all the maxl PATH changes or if you need to update your environment variables to correct the essmsh command to work in a command prompt.

  • "Load files into Photoshop layers" fails to complete CS6

    Hi all,
    Hoping someone can help with the folling problem with Photoshop & Bridge CS6
    When in Bridge, after selecting 6 images (CR2) using the command TOOLS>LOAD FILES INTO PHOTOSHOP LAYERS the first file will load into Photoshop, Photoshop will then generate a second blank layer and then read the second file. At this point the "script" will stop. I am left with a document with 2 layers. The top layer has my first image, the bottom layer is empty.
    At this point when I quit Photoshop I am prompted to save this open document which appears to be the only open document. I choose not to save this as a file. I then get a dialogue box prompting to save another open document. Photoshop has loaded the second file to place as a layer but as the "script" has aborted I am left with an open, but invisible file.
    When I first loaded CS6 on Snow Leopard, it would demonstrate this behaviour every time I attempted to run this command from Bridge.
    I did a clean install on a blank HDD of OSX Lion. Installed CS6. The command worked without fail for about a month.
    Then I would get the command aborting occasionally. Restarting Photoshop would let me continue for a few hours before this aborted script problem would happen again.
    Over the last week it has become more frequent, to a point where this workflow is unusable.
    A restart of Photoshop may fix the problem for the next batch of images, only to fail again soon after, or fail on the first attempt after a relaunch of Photoshop.
    A reboot of my computer will allow my to load one or two sets of files before again failing to complete the command.
    I have tried the following:
    In Photoshop preferences:
    disabling the "Use graphics Processor"
    Increasing or decreasing the amount of RAM available to Photoshop
    Changing the cache levels or changing the cache tile size
    changing the scratch disk
    Trashing the Photoshop preferences file (Photoshop Settings.psp)
    In Bridge
    Purging the cache
    Increasing or decreasing the cache size
    Resetting Bridge preferences (holding Command on launch) and deleting all cache files.
    In general system
    Quitting extra programs (Safari, Thunderbird, iTunes)
    Sometimes this will seem to then allow Photoshop to load a full set of images, only to abort again after a few sets.
    Rebooting the computer - again will work for a few images sets before again failing.
    Now the fact that it worked fine for several weeks without presenting a problem would indicate that it is not a bug.
    The fact that is slowly started happening then became more frequent would indicate something changing slowly over time - a larger cache folder perhaps, although purging known Bridge cache folders has not filed the problem.
    Really at the end of my tether here. Even considering downgrading to CS5 - but don't want to have to use the older Adobe Camera Raw.
    System is as follows:
    Mac Pro 2 x 2.66 Quad Core
    24GB RAM
    ATI Radeon HD 4870 512
    OSX Lion 10.7.4
    I have seen a couple of others have posted having a the same problem, both with CS5 and CS6.
    Hoping someone has an answer.
    Thanks.

    Hi JJMack - I just re-read your post. For some reason I thought you were suggesting to make sure "Open documents in Tabs" was selected, it was. Now I realize you were suggesting to turn it off! As another attemp to solve this problem I did de-select it today. Seemed to work for a good while. I was getting very excited, then, on the last set of images I had to do it displayed the same problem. But, it did go for quite a while without failing, and when it did I was thrashing about trying to make another app active. When loading documents like this - with "Open documents in Tabs" de-selected, Photoshop wants to put the loading images as the front-most window, no matter what other apps (Bridge, email, web etc) I click on in the dock. I think it is related to the bug you described effecting the "load files to stack" command.
    Hopefully Adobe is looking at this - mind you, I have read reports of people having this problem in CS5! Looks like that was never resolved sadly.
    I'll keep testing and post back.
    I am looking to upgrade my video card to see if it's a video memory thing.
    What is very weird though is the fact that this problem didn't present itself until after several weeks of working with this command with no problem. No additional apps installed, nothing changed. Why would it start happening only after a while?
    Thanks again for your suggestion.

Maybe you are looking for