Dynamic File name for Open Hub file

Hi All,
I wanted to create a .csv file using open hub destination. I wanted the name of the file to be dynamic based on month. for example in jan I wanted it as 01.Dump for January and 02.Dump for february.
is is possible at all to do that.I wanted to save the file in the application server. There should not be any manual intervention the process.
Thanks in advance.
Regds
Raghu

Hi
We have take month from the first record that we read.
Our requirement is to take one months data and give it in a file with a file name having the corresponding month.
In the code mentioned below MOC_CODE is the field that is used for this purpose.
Hope it helps.
Regards,
Raghu
code:
#!/bin/sh
Script to dump file.
Parameters.
$1 Division name to extract from the data file.
It re-arranges the columns.
It replaces values in strings.
Parameters.
DATA_FILE_NAME="data_file.csv"
HEADER_FILE_NAME="header_file.csv"
DIVISION_NAME="$1"
Re-arrange header file columns.
Transpose rows to columns comma separated.
HEADER_ROW=`cat "$
Re-arrange header columns.
Re-direct the output to a temporary file.
" | tr '\n' ',' | sed 's/,$//g'`
echo "$" | awk 'BEGIN { FS = ","; OFS = "," } { print $2, $3, $1, $4, $5, $6, $7 }' > "$.$.tmp"
Prepare awk program.
Re-arrange data file columns.
Replace UNI in 6th column with UNIT and Replace TON in 6th column with TONS.
Filter division rows.
AWK_PROGRAM="BEGIN { FS = \",\"; OFS = \",\"; TVAL = 0 } \$5 ~ /$/ { sub( \"UNI\", \"UNIT\", \$6 ); sub( \"TON\", \"TONS\", \$6 ); print \$2, \$3, \$1, \$4, \$5, \$6, \$7; TVAL = TVAL + \$7 } END { printf \"$ Total Value: %f\", TVAL 2> \"$$Re-direct the program to a temporary program file.Control.ctl\" }"
echo "$" > "$.awk"
Execute the data file formatting command.
awk -f "$.awk" "$" > "$.$
Get generation date.
Get moc code from data file.
.tmp"
GENERATION_TIME=`date +"%Y%m%d_%H%M%S"`
MOC_CODE=`head -1 $ | awk -F, '{ print $3 }'`
Prepare dump file.
DUMP_FILE_NAME="$_$_$_$"
cat "$.$.tmp" "$.$.tmp" > "$
Remove temporary files.
FTP dump file to remote server.
FTP.
rm *.tmp
REMOTE_SERVER="<replace with server ip address>"
REMOTE_USER="xxxx"
REMOTE_PWD="xxxx"
ftp -n "$" << EOF
     quote USER "$"
     quote PASS "$"
     ascii
     put "$"
     bye
EOF
Exit.
exit 0

Similar Messages

  • Displaying file name for open Acrobat files

    Is there a way to copy and paste the URL for an open pdf file in Acrobat? We currently open the file in MS Word and copy the file link from the web toolbar display.
    Thanks for the help!
    Ken

    Thanks for the quick response. Is that a hard thing to do? We haven't done much with Java Script.
    Ken

  • Assign Logical file name for the physical file path through Program

    Hi all,
    I am having a physical file which is getting generated dynamically. It is having the date and time stamp in its name which is added at runtime.
    Now I need to assign a logical file name for the physical file path through the program.
    Is there any FM or any other method to assign the same.
    Gaurav

    I think it is not possible. becuase the date & time added at runtime. so if you check the table  PATH you can find filename and their definitions

  • Log4j - issue in configuring the file name for daily rolling file adapter

    We have configured the log4j properties. We want to create back-up of log file each hour. The file name of the log file is MyApp.log and as per the below configuration after each hour backup file is created as
    MyApp.log<<time>>
    but we want that file should be created in follogin format
    MyApp<<time>>.log
    Below are the log4j properties configured, please let us know, what should be the correct option to create the filename in desired format.
    # Set root logger level to DEBUG and its only appender to MyApp.
    log4j.rootLogger=DEBUG, MyApp
    log4j.appender.MyApp=org.apache.log4j.DailyRollingFileAppender
    log4j.appender.MyApp.File=D:/logs/MyApp.log
    log4j.appender.MyApp.DatePattern='.'yyyy-MM-dd-HH
    log4j.appender.MyApp.Append=true
    log4j.appender.MyApp.layout=org.apache.log4j.PatternLayout
    log4j.appender.MyApp.layout.ConversionPattern=[%d{yyyy-MM-dd} %d{HH:mm:ss z}] %m%n

    yes you can use /SAPDMC/SAP_LSMW_IMPORT_TEXTS via LSMW
    In the SAP system, there is no uniform rule for the structure of the actual text key Textname. However, in order to be able to maintain the structures and fields, you have to know what the structure of text name as well as the values for text object and text ID are.
    Procedure
           1.      Display a text of the required text type.
           2.      Branch to the editor.
           3.      Choose Goto > Header.
    The Text header dialog box appears.
    Result
    In the Text header dialog box, you gather the required information.

  • Dynamic file name in Open hub

    Hi Friends,
    I am using Open hub to send a flat file to an application server. the file name should be dynamic.
    for eg. returnsYYMMDD.dat similarly salesYYMMDD.dat.
    please help me as i dont know how to have this dynamic value in case of flat file on application server.
    Thanks
    Ujjwal goel

    Hi,
    Pls go through the below lionk
    http://www.sdn.sap.com/irj/scn/index;jsessionid=(J2EE3417300)ID1655136650DB02514444191271871877End?rid=/library/uuid/01d3a090-0201-0010-9783-bc33ab690e70&overridelayout=true
    It may help you
    Regards,
    Marasa.

  • Dynamic Resource name for Excel/csv files

    Hi All,
    Reading from a source excel (as well as csv) file, I tried passing the resource name via a variable which is set to contain the name of the file (refresh). However, on execution, the file name shows up with an additional "\" character without being specified in the variable text causing the interface to face on load step.
    The error says:
    ODI-1227: Task SrcSet0 (Loading) fails on the source FILE connection <ConnNameHere>.
    Caused By: java.sql.SQLException: ODI-40438: File not found: C:\DirectoryNameHere\ /OTD.
    Is this expected behavior where one needs to escape the special character?
    I've verified that the extra / is not present in either the variable value or the directory for the Physical Schema.
    TIA.

    http://youtu.be/-QMV6cElgsk
    http://youtu.be/V7OzzZ3kYdc
    http://youtu.be/hNqqbZ4sJWA
    http://youtu.be/TMHzhtEwgrA
    http://youtu.be/REJDi584jh8
    http://youtu.be/jE6k5OfWqi0
    http://youtu.be/P3EKyykseps
    http://youtu.be/-QMV6cElgsk
    http://youtu.be/Gl7YvZohVVA
    http://youtu.be/zb1ue5BP9mI
    http://youtu.be/NhPDcc8n4VU
    http://youtu.be/tD_kw5QXmps

  • Export Indd to EPS/JPG and set the file name  for EPS/JPG file

    Hi,
       When I export the INDD to JPG/EPS, I want to set the file name with pageNumber  for JPG/EPS files using javascript.
    For Example
    If I set the file name as EPSFile.eps, after exporting the indd(with 2 pages) to eps
    ,files are generating in the following name EPSFile_1.eps, EPSFile_2.eps.
    but I want to set the file name as EPSFile_001.eps and EPSFile_002.eps using javascript.
    anyone knows please reply for this.
    Regards,
    Mubeen

    Hi,
      I tried the following code.
    var JPGe = new File("Applications/PDF/JPG/file.jp");
    app.activeDocument.exportFile(ExportFormat.jpg, );
    when I use this code ,exported jpg file names are
    file.jpg, file1.jpg,file3.jpg.
    but ,I want the output file names as file_001,file_002,file_003,
    Thanks,
    Mubeen

  • Setting file name for a downloaded file

    I've set up a file download using code I've gleaned from jsf forums. However, the file name is not being set correctly. When the user downloads File.doc, it shows up as downloadPage.jsf. Am I setting the header correctly?
    public class VendorInfoBean extends AbstractViewController {
        public VendorInfoBean() {
        public String downloadVendorApp() {
            ExternalContext context = getExternalContext();
            String path = context.getInitParameter("externalFiles");
            String filename = "Vendor_Application_e_Form.doc";
            String fullFileName = path + filename;
            File file = new File(fullFileName);
            HttpServletResponse response = (HttpServletResponse) context.getResponse();
            response.setHeader("Content-Disposition", "attachment;filename=\"" + filename + "\"");
            response.setContentLength((int) file.length());
            response.setContentType("application/msword");
            try {
                FileInputStream in = new FileInputStream(file);
                OutputStream out = response.getOutputStream();
                // Copy the contents of the file to the output stream
                byte[] buf = new byte[1024];
                int count;
                while ((count = in.read(buf)) >= 0) {
                    out.write(buf, 0, count);
                in.close();
                //out.write(bytes);
                out.flush();
                out.close();
                FacesContext.getCurrentInstance().responseComplete();
            } catch (IOException ex) {
                ex.printStackTrace();
            return null;
    }

    StringBuffer sbFilename = new StringBuffer();
         sbFilename.append("adeem");
         sbFilename.append(".doc");
    StringBuffer sbContentDispValue = new StringBuffer();
         sbContentDispValue.append("attachment");
         sbContentDispValue.append("; filename=");
         sbContentDispValue.append(sbFilename);
    HttpServletResponse response = (HttpServletResponse) context.getResponse();
    response.setHeader("Content-Disposition", sbContentDispValue.toString());
    i think this will work .. if not let me know i will give some code that will work for u then ...

  • File Name for Proxy to File

    Hi experts,
    My Scenario proxy to file(FTP). Currently in my Sender Data Type Proxy one of the field holds the file name to be created at the FTP.
    Could anyone help me how to use that field data (name) to create the file(FTP) with that name?
    Thank you experts.
    regards,
    s.saravannan

    Hi,
    You can get the same by creating a simple UDF (one argument - fname) and use the following code:
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String filename = fname;
    conf.put(key, filename); 
    return  "true";
    Additional parameter, in Receiver communication channel is, provide file name as * and "Set Receiver File Name as Payload Attribute Value".
    Regards,
    Sachin Dhingra

  • Keep file names when opening multiple files as animation

    Hi, i use fireworks when creating huge amount of photo
    resizing/cropping, where i need to manualy choose the cropping and
    size according to orientation /Horiz. vs Vert./ - i think that
    batch processing is not a good option.
    So, i use open as animation option in open dialog, i have all
    images (+-100) in frames. Is it some way to keep filenames in Frame
    Names, without need to do it by hand? Couse then i can export all
    images in one click.

    quote:
    Originally posted by:
    igraq
    Hi, i use fireworks when creating huge amount of photo
    resizing/cropping, where i need to manualy choose the cropping and
    size according to orientation /Horiz. vs Vert./ - i think that
    batch processing is not a good option.
    You can set up a batch process without having to enter those
    values manually all the time. Do the steps once, on one image only,
    and record the procedure in a custom command. Then call your custom
    command from the batch process as usual. Fireworks will perform
    your recorded steps on the rest of the images while you can sit
    back and relax. ;-)
    And like Darrel wrote above, using percentages will make
    image orientation irrelevant.
    For further details about custom-made commands, you can check
    this
    tutorial.

  • A black bar comes up on my file names when opening a file

    Don't know why, but a black bar, gradient black too, not just a black out appears on my folder view when I open files in Logic Pro.
    Here's a picture of the anomoly.
    Any ideas what's causing it?
    http://farm3.static.flickr.com/2645/39263403264296c092a2b.jpg
    If I click on Documents or Desktop, it's still there, but not in Applications.

    That's good to know. I have wondered how that is done.
    You sir are indeed the Captain.
    !http://img41.imageshack.us/img41/2006/captaineq.jpg!

  • How to give dynamic name for csv export files?

    Hi,
    how we can give dynamic file name for each csv export file? ex(&item_name.csv)
    I am using apex 4.1 and IE 6,
    thanks in advance
    regards
    Chandran

    Please help me on this
    I am using report template as a csv export..
    when user click on download link on other page he will redirect to csv export temlate page and he is is directly get the open or save window
    but dynamic title name is not working for only for this.
    regards
    Chandran

  • Custom dynamic names for outbound payment files in R12

    I have asked this on a couple of forums, but somehow missed this one.
    We are upgrading from 11i to R12 and require custom dynamic file names for the Payments output files (cheques, advices, efts). I see that you can create a custom prefix and extension through payment profiles, but the functionality is very limited (i.e. no date stamp). I am thinking that others must have come across this before, and am wondering how you have handled such a requirement. Is it possible to add custom steps to the seeded payment process? Can the payment process be run as part of a request set and then a custom step added which grabs the output file and renames it based on information obtained from the batch and the process profile. Our goal is a fully automated payment process where batches are scheduled, processed and files renamed and sent out to banks and a 3rd party printer with no user interventation.
    Any advice/tips would be appreciated.
    Thanks.
    Tam.

    Hi Tam,
    Could you please let me know if you got the solution as we have a similar requirement of renaming the output file as perthe business needs fro which we need custom program.
    Thanks,
    Manas

  • When someone other than myself downloads an image from my web album, a dynamically generated file name replaces the original file name.  How I can prevent the original file name being replaced during the downloading process?

    When someone other than myself downloads an image from my web album, a dynamically generated file name replaces the original file name.  How I can prevent the file name being changed during this downloading process?

    Hi Glenyse,
    Here are my steps.
    1.  I upload multiple image (jpg) files onto my photo album.
    2.  I select the "sharing" by email option for this album.
    3.  I enter the recipient's email address.
    4.  The recipient receives my message and clicks on the link.
    5.  The recipient accesses my photo album and clicks on one of the images.
    6.  The image opens up to its own screen.
    7.  The recipient selects the "download" and then save file option.
    Here is the part I do not understand.  For some reason, during this "download" process, the original name which I have given to the file is replaced by different name.  So I was hoping that someone knows how to prevent the file name from being changed during the "download and save" process.
    Much appreciated if you can help me find a solution to this problem.
    Mary  

  • How to create Same file names for source and target.

    hi
    Can any body send Procedure for below requirement.
    how to create the dynamic file names for a source and save the file with same name in the Target, because it has to identify that which sender had sent the file and the target file should be again sent back to the customer as a link.
    Please help me.
    Thanks

    Hi,
    See the below link
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14 - sender file name as receiver file name
    Regards
    Chilla

Maybe you are looking for

  • Is there a way to skype with more than 25 people a...

    My professor is looking to skype our entire class of about 60 students at once to lecture. Is this possible?

  • Unrecognized mp3 pla

    Hello, this is the first time on the board and I have a very taxking problem. To start I am running windows xp svc pak3. 3.2mhz 2.5gb of memory, 300gm hard dri've with 65% free and a second hd of 250gb. I have plenty of speed and memory. I have a Cre

  • MAJOR disappointment - PGP and GPG won't work

    I've been using GPG (Open source version of PGP) to sign important e-mails for some time now. After upgrading to Snow Leopard, GPG quit working, so I did some research. It seems Apple has made so many changes in Mail that neither PGP nor GPG can be u

  • Master track vs. output track

    I am having trouble with the following issue: When I want to control the overall volume of a project or add a mastering preset I am unable to access a "master track" for some projects. Under the drop down view menu I can show or hide only an "output

  • Corrupt DataLog file?

    Long time someone post something regarding the DataLog files. You know, File I/O\ Advanced File Functions\ DataLog Is it because it's "old skool" and there is something better now?? Anyway, allow me to ask this question. I have several DataLog files,