Automate script for import data

automate script for importing data to the cube from txt files.
Ex: - I have below 2 files for import
aaaa.txt
bbbb.txt
For the above simply i can write esscmd or Maxl script for importing files .
Esscmd :
IMPORT 3 "\aaaa.txt" 4 "N";
IMPORT 3 "\bbbb.txt" 4 "N"
my question , suppose if some more files added to the existing files, for example cccc.txt got added ,how can i write a code for this?

Well I guess this will do
dataDir=" " # Give the data directory path here
maxlFile="maxl1.msh"
cd $dataDir
for file in `ls *` ;
do
maxlStmt="import database sample.basic data from data_file '$file' using rules_file 'xxx.rul'
on error write to 'xxx.log';";
printf $maxlStmt >> $maxlFile
done
ls * is lists all the files in the directory. If you want to be more specific and if you yhink tat your data folder may contain more files then you can use "ls *.txt" if your file extension to load is txt.
Well I haven't tested this as I am on vacation...So you can just follow the similar way.
This is only for the 3rd point which you said

Similar Messages

  • Script for Importing data

    Hii All
    I want to run import of all the datafile s with help of script
    I have many datafile s with differant users and I want to run db import
    Plz Help me How to write a script .
    Thanking You

    GaurAVS,
    I don't know what were the reaosns that made you selected this option, question did you try using any other options to move data from source to destination. Couple of questions for you?
    1. One single export dump for each schema user or is it more than one file?
    2. I assume from your earlier post, you got more than 50 schema users in your database?
    Here is simple bash script, assuming you have one export dump file for each schema user. Make a directory call data and move all the dump file, please read script carefully for more instruction and modify according to your needs.
    In addition before running this script on linux box run follwoing from command prompt
    $dos2unix import.sh
    #!/bin/bash
    function importfile
         echo "importing $file for user $1"
         imp $1/$2 full=y file=$file log=./data/`basename $file dmp`log
         test=$?
         if [ $test -ne 0 ]
         then
                echo "Importing for user $1 failed ..."
             exit 1;
         fi
    function listfile
        # you have to supply username and password here
           for file in ./data/*.dmp
           do
             echo "exporting $file for $1"
             # If you used username as filename for each export dump
              unset username
              +username=`basename $file .dmp`
              echo "Username is set to $username"
              # Now to get password for this username ; you can create a file with
              # this format username=password
              # $1 -- Username
              # $2 -- Password
              unset pw
              pw=`cat ./data/pwd.txt.txt|grep $username|cut -d'=' -f2`
              echo "Password is set to $pw"
              # You have to write a small function to get username and password
              importfile $username $pw
               done
    listfile $1 $2Edited by: OrionNet on Dec 20, 2008 11:47 PM

  • How do I activate AUTOMATIC superscripting for numbers / dates; e.g. 1st, 2nd, 3rd, 4th, etc .... It used to do this in all PRE-5.0 versions of Pages; now, it is GONE from Pages 5.0, and I cannot find out where / how to activate it !!

    How do I activate AUTOMATIC superscripting for numbers / dates; e.g. 1st, 2nd, 3rd, 4th, etc .... It used to do this in all PRE-5.0 versions of Pages; now, it is GONE from Pages 5.0, and I cannot find out where / how to activate it !!

    Whilst I appreciate your responding - I do not think this helps with what I was enquiring (at least not without further explanations anyways).
    I am aware of, and do use, the function - System Preferences > Keyboard > Text - for various replacements like (tm), (c), etc .... and also for fractions like 1/2, 1/4, 1/3.
    However, my question was in relation to SUPERSCRIPTS for dates / numbers - namely, superscripting numerical suffixes for things like 1st, 2nd, 3rd, 4th,
    So - please help - HOW do I set this up ? If indeed it is possible without System Preferences > Keyboard > Text ???

  • How to Flip the Sign using Calculation script for historical data

    I am currently using Essbase 9.3.1. Its required to flip sign for a specific set of accounts for that i am currently using UDA's to flip the sign.
    But now i need to flip the sign for the historical data too. Is there any possible way to flip the sign using calculation scripts for historical data. Kindly let me know your suggestions.
    Many thanks in Advance...
    Edited by: [email protected] on Jul 30, 2009 9:37 PM
    Edited by: [email protected] on Jul 30, 2009 10:58 PM
    Edited by: [email protected] on Jul 30, 2009 11:01 PM

    Of course there is. This is the kind of calc script that only gets run once, so make usre you test it well before doing it on production and make a backup of production before doing it.
    It would be something like
    Fix(time frame, accounts to be flipped, level zero other dimensions)
    actual = actual * -1;
    EndFix
    Cal dim dimensions
    Note, I chose actual, but you could do it for any dimension that has a single or only a couple of members. What ever dimension you choose to do the calculation on, it can't be included in the fix statement

  • Address Book field names changing for "imported" data

    I'm migrating from a thousand year old Palm Pilot that has served me so well to an iPhone. So it's time to get my contacts into OSX Address Book.
    I have tried moving the data a couple of ways - exporting vCards and text files from the Palm Desktop software.
    I did extensive editing of the text file in MS Excel to get the data into good order.
    I have set up a template in the Address Book preferences to create fields that I want/need. Some are generic default field names, some have custom names. eg. I want to see a field called "Bus. Phone" not one called "work". Call me picky.
    I get the same basic result no matter if I import the vCard file or a text file - The names of the fields just show up with very generic names in the imported data. I should note that creating a NEW record seems to use the field names that I have specified in the preferences.
    Also, when importing the text file, Address Book asks me to assign the field names for certain fields (while it seems smart enough to know what labels to use for other fields all on it's own). However, the Field Names available in the drop down menu ARE NOT the ones that I have set up in the prefs. I seem limited to the generic default field names only.
    Can anybody tell me how to get the field names to be what I want them to be for address data that is being imported like this?
    Thanks for any suggestions - this has been driving me crazy as it would seem to me to be a pretty basic process. (I mean, the Address Book has this import functionality and custom field name functionality built in so it should work right?!)
    Allen

    No sooner do I ask than I notice that other people have asked the same question. In one of the reply's I saw mention of a product called "Abee".
    I tracked it down and it did the job for me! Custom Field names live on!
    It's at:
    http://www.sillybit.com/abee/

  • Tabular Modeling. What is the best practice for importing data into VS to limit the records in the designer?

    Should I wrap the queries in a procedure with a @StartDate and @EndDate and create a test partition to pass a small date range? 
    Or can i use the Table properties screen to put the command there and will it run and not be affected or affect the partitions?This would be nice if this SQL statement on this screen was independent of the partitions and I could just leave it with the the
    command text = EXEC TransactionDetail '2014-01-01', '2014-05-31' Especially since if you have many tables that load based on a date range. i would not want to jump in and change that query on all of them.
    Is there a a way to have a parameter in the project so all tables would get the same @startDate and @EndDate so I could change it in one place?
    And I am not stuck to these questions\options, If there is a better way to mass change the queries to run a subset of data for the designer I'd like to hear it.
    Thank You,
    Phil

    Hi Phil,
    According to your description, you are looking for the best way to control the rows that are loaded into a table, right?
    When importing data to a table of tabular model, we can apply filters to control the rows that are loaded into a table. After you have imported the data, you cannot delete individual rows. However, you can apply custom filters to control the way that
    rows are displayed. Rows that do not meet the filtering criteria are hidden. For the detail information about it, please refer to the link below.Filter Data in a Table (SSAS Tabular)
    If I have anything misunderstand, please point it out.
    Regards,
    Charlie Liao
    If you have any feedback on our support, please click
    here
    Charlie Liao
    TechNet Community Support

  • How to make an insert script for CLOB data types?

    I need to have an insert script for Oracle 11g where I insert large texts into a CLOB field
    I exported data from a source table using TOAD's export dataset and the insert statements option, so it generates a script of just simple insert into statements with the clob strings in the values clause within single quotes.
    While most of the inserts succeed, several fail with the error: string literal too long
    How can I insert long texts into clobs?
    One workaround I was considering, is maybe breaking up those inserts which are too big, so that it inserts a chunk, and then does an update to append additional chunks? not sure if that would work either
    first wanted to get any ideas from the oracle experts here in case there is a much easier, non-manual labor intensive way.

    Thank you for that informative link, Raj
    I wouldn't be able to use SQL Loader for this though, this is something that gets submitted to a DBA in a request and it must be in a script that can be run in Sql Plus, and it cannot pull it from a table or file.

  • Using  FDM Import Action script to import data from ERPI table "tdataseg_t"

    Hi Experts
    I have extracted data from EBS using ERPI and loaded into the intermediate table "tdataseg_t"
    I am trying to use Import Action script within FDM to extract data from "tdataseg_t" table (where ERPI extract data is stored) as i could not use the normal import script.
    Requirement : I have to restrict the custom 2 dimension based on Account dimension.
    Dim Account
    Account = ???? ( i am struck here)
    If Account = 1000 to 5000 Then
    Custom2 = Right( product , 5)
    End If
    but , I could not find the exact syntax to call the Account dimension from the "tdataseg_t" table.
    Please Advise
    Thanks
    Sak
    Edited by: user12292415 on Feb 26, 2012 1:19 AM

    Hello,
    Importing data via a manual script defeats the purpose of ERPi. As it will not provide you an audit trail, drill-through/drill-back, etc.
    Your best bet is to use the default settings by the software. Just because it returns more records than you want is not a bad thing. You can conditionally change/alter the information either in an EventScript inside of FDM or by mapping the un-needed information to IGNORE.
    Thank you,

  • Is it possible to create an Apple Script to import data from a web data feed (RESTful XML/JSON)?

    Before I get started looking for a programmer, does anyone know if it will be possible to create a script that will allow Numbers to connect to an external data feed in either XML or JSON? I want to enable some colleagues who use Mac to connect to the same data feed that Excel for Office connects to.. Thanks,

    It is definitely not hard to import XML or JSON data via an AppleScript. As an amateur tinkerer, I found a way, for example, to bring in OFX data from my bank (OFX is a flavor of XML) using the XML parser built into System Events, which is AppleScriptable.
    How satisfied your colleagues would be with the solution, though, will depend on what you mean by "connect to an external data feed." If you are dealing with datasets in the thousands of rows and need frequent and rapid response, then you may not be happy. In that kind of situation you would need to expect at least a few seconds of wait time every time you "refresh."
    If, as in my case, you have only a few hundred rows and don't need to bring the data in every few seconds, then the AppleScript solution is very practical. The programmer could probably goose the performance and make the job easier by using AppleScript as a wrapper for a script in Python or another language that is faster than AppleScript at parsing XML and JSON.
    SG

  • FDM Script to import data

    Hi,
    I'm new to FDM scripting. So any pointers will be appreciated. I need to import a TB with the following format in exel file.
    row1 ***CostCenter Number***
    row2 ***TB name*
    row3 - Other parameters
    row4 - Blank
    row5 - Data headers
    row6 - Data begins - format given below -
    row7 - Account Desc Opening Bal Closing Bal
    I have created an import format with the 4 fields - CostCentre, Account,Desc and closing bal. Now my question is -
    1. How do i create script that picks the costcenter number from row1 ?
    Thanks in Advance!!

    That format will not work in an excel file, FDM requires a specific excel template, also the FDM excel templates do not use import scripts,so first convert to a csv file.
    You will then need to use a temporary variable for this e.g. RES.PvarTemp1 and create 2 import scripts
    Assuming that cost centre is the only value on line one of the file what you need to do is:
    Attach an Import script to the Amount entry in your import format and put in the following code (this assumes cost centre is always the first header line and your script is called GetCostCentre)
    If Not Len(RES.PvarTemp1) > 0 Then
    RES.PvarTemp1 = DW.Utilities.fParseString(strRecord,4,1,",")
    End If
    GetCostCentre = strField
    Attach an import script to the CostCentre entry in the import format called SetCostCentre, it will have one line
    SetCostCentre = RES.PvarTemp1
    There is a very similar example in the FDM admin guide Scripting cahpter which has a bit more description.
    Edited by: SH on Dec 7, 2012 11:17 AM

  • Automated scripts for importing & sharing on Mobileme?

    How would I go about writing a script to automate the following process :
    1) (Trigger for script): I insert my SDHC card from my camcorder into my iMac card reader.
    2) Launches iMovie and imports all clips as new event.
    3) Creates a single project by including all of the events just imported.
    4) Shares the project on Mobileme.
    Currently I'm only managing to view, compile and share movies of the kids when I get (a very rare!) few hours at the weekend. If I could just pop the card into the reader on my way out to work in the morning it would transform my usability of iMovie and mobile me, as I could then view and share the 10-15mins of precious footage I took the night before.
    Many thanks,
    D

    Thanks for info.
    The work around I'm using at the moment is to plug in the card in the morning, then access my Mac remotely using Jaadu VNC via my iPhone to do the import and publishing.
    Does the job, although a little more cumbersome and need reliable 3G / WIFI connection.

  • Problem in sap script for Item data

    Hi Guys ,
    Although I am working in ABAP for last 1 year but I am new to SAP script , This is first time I am doing this -
    I am creating excise invoice profarma and able to print all that data except J_1IEXCDTL ( Item data ) that I have to display in loop ,
    I am using
    LOOP AT ITAB_J_1IEXCDTL.
      CALL FUNCTION 'WRITE_FORM'
           EXPORTING
                ELEMENT = 'ITEM_VALUES'
                WINDOW  = 'MAIN'
           EXCEPTIONS
                ELEMENT = 1
                WINDOW  = 2.
    ENDLOOP.
    My problem is that this is working fine for 1 record but if there are more than 1 record in ITAB_J_1IEXCDTL. , it is showing only first record ,
    Other thing i want to know what is connection of element between Driver program and sap script , Can we give any name to element and it doesnt make any impact on Sap script
    i have done same in my program ,
    Thanks in advance
    Amit

    my problem is solved now ,
    Thanks

  • I need a script for importing a PDF into IDCS3

    I used the script that came with InDesign... specifically PlaceMultipagePDF.jsx...
    And that worked well.. except for the fact that we just found out that this large PDF has oversize pages (larger than 8.5 x 11) and that plugin is not shrinking to fit. I had a plugin for IDCS2 that would give me import options.. but this PlaceMultipagePDF.jsx doesnt seem to have any options...

    There's a script in the InDesign Interchange site called PDF Multipage Import MAC that will do it, if you know the percentage that you want the PDF scaled to.
    It's my Martin Sretr. It's written for CS, but I think you know how to deal with that, Chris.

  • Script for importing files, distributing them to layers, and cutting length?

    Hi, is it possible to import a sequentially numbered set of .psd files and then automatically distribute them to their individual layers and cut them each to a specified length of say 4 seconds, timing them to be visible one after another?
    I'm working with a series of storyboard panels and would just like to lay them out in After Effects' timeline sequentially, so they would be visible one after the other...is there a script or action to automate this?  Thanks

    I'm working with a series of storyboard panels and would just like to lay them out in After Effects' timeline sequentially, so they would be visible one after the other...is there a script or action to automate this?  Thanks
    hi
    try >Animation>keyframe assistant>sequence layers in AE.
    and cut them each to a specified length of say 4 seconds, timing them to be visible one after another?
    this script might help http://www.redefinery.com/ae/view.php?item=rd_CompSetter

  • Script for current date

    I have a document javascript that used to work. It prints the current date upon first opening the PDF into a field called Today. Thereafter, the date does not change no matter how many more times the PDF is opened.
    var f = this.getField("Today");
    if (f.value == "") f.value = util.printd("mm/dd/yyyy", new Date());
    I'm using Acrobat 9 Pro, and for some reason this script no longer works in version 9. If anyone can assist to correct this sript, I would greatly appreciate it.

    It works fine for me in Acrobat 9.2.0 (under Windows 7). If the field is empty when the form opens, it inserts the current date. If the field is not empty, it does not do anything.
    Are you absolutely sure that the field 'Today' is empty when you open the PDF?

Maybe you are looking for

  • PS CC (since JAN 2014 update) Layer-mask editing causes hangs/crashes

    ONLY since JAN 2014 update, PS CC has been hanging/crashing when I paint/edit a layer mask. All may be well at first (or not), but suddenly the display of the mask (or mask overlay on the layer itself, as shown when hitting backslash key) is not show

  • How to create a Return Order from a Quality Notification?

    Hi everyone at SDN. Really need some help on this issue we are having. We want to create a Return Order from a Quality Notification, ie. the document flow should be: :: Serv. notif 000200000482    :: Return Order 0060299453 In the SAPGUI we are able

  • Parallel Execution in SQL Job

    Hi Team, I am facing the below mentioned issue while running a job, and this is issue is not daily instead it occurs only some times, please suggest what could be done to solve this. "the query processor could not start the necessary thread resources

  • Vista and XP Machines cannot see HomeHub3

    My Vista and XP Machines, plus iPod Touch can all connect to my outgoing wireless HH2 without problems.  However, only the iPod touch can see the new wireless HH3!  Over an hour spent with the help desk in India resulted in being told that the proble

  • HELP!! wierd power issue.

    Help! i have searched everywhere for a solution. I have a hp dv7 1200cto noteboook pc. I have been having an issue with the battery constantly charging. My old battery died and wont really hold a charge anymore. I bought a new battery off ebay and it