Rename exported file in ODI with help of Java

Hi.
We have to implement new scenarios into execution repository. I marked scenarios and I exported them with help of procedure:
OdiExportScen "-SCEN_NAME=#scen_name" "-SCEN_VERSION=-1" "-FILE_NAME=#DEP_EXPORT_DIRECTORY\SCEN_#SCEN_NAME 001.xml" "-FORCE_OVERWRITE=YES" "-RECURSIVE_EXPORT=YES" "-XML_VERSION=1.0" "-XML_CHARSET=windows-1251" "-JAVA_CHARSET=cp1251"
But I have to put space between variable #SCEN_NAME and another part of file name. After export I want to rename file with help of Java script, but I get an error when I try to read list of files.
import java.io.*;
public class RenameFiles
     public static void main(String[] args)
          String dirPath = new String ("D:\\ODI");
          File dir = new File(dirPath);
          String dirList[] = dir.list(); /* I get error there*/
          for(int i=0; i<dirList.length; i++)
               File oldFileName = new File(dirPath+"\\"+dirList);
               File newFileName = new File(dirPath+"\\"+dirList[i].replaceAll(" ","_"));
               oldFileName.renameTo(newFileName);
Error in ODI Operator looks like:
org.apache.bsf.BSFException: BeanShell script error: Parse error at line 9, column 31. Encountered: [ BSF info: Rem at line: 0 column: columnNo
     at bsh.util.BeanShellBSFEngine.eval(Unknown Source)
     at bsh.util.BeanShellBSFEngine.exec(Unknown Source)
     at com.sunopsis.dwg.codeinterpretor.k.a(k.java)
     at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java)
     at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
     at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
     at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
     at com.sunopsis.dwg.dbobj.SnpSessTaskSqlS.treatTaskTrt(SnpSessTaskSqlS.java)
     at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
     at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
     at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
     at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
     at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
     at com.sunopsis.dwg.cmd.e.k(e.java)
     at com.sunopsis.dwg.cmd.g.A(g.java)
     at com.sunopsis.dwg.cmd.e.run(e.java)
     at java.lang.Thread.run(Thread.java:662)

I fixed it.
All I need - put slashes at end of directory name. Also I removed implementation of class.
import java.io.*;
String dirPath = new String ("D:\\ODI");
File dir = new File(dirPath+"\\");                // I put \\ at the end of directory name
String[] dirList = dir.list();
for(int i=0; i<dirList.length; i++)
     File oldFileName = new File(dirPath+"\\"+dirList);
     File newFileName = new File(dirPath+"\\"+dirList[i].replaceAll(" ","_"));
     oldFileName.renameTo(newFileName);
Edited by: user12281180 on Apr 14, 2011 7:44 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • XI Mail Adapter: sending emails with attachment with help of java mapping

    Hi ,
    On trying out the scenerio mentioned in the blog, using the java mapping provided
    "XI Mail Adapter: An approach for sending emails with attachment with help of Java mapping
    The scenerio works just fine.
    But the payload as the content of the attachment is not getting generated in proper XML format.
    I suppose it's because of the replace special characters code part..
    Can anyone help me state the modification required in the code.
    Thanks!
    Regards,
    Faria Mithani

    It might be a codepage issue. Is your original payload UTF-8?

  • Could renaming export file stop videos from playing

    I am puzzled as to why the videos embedded in a swf file play
    okay within the swf file, but do not play okay on my website. I
    have made sure that the swf file and respective flv files are all
    uploaded to the server, but none of the videos play.
    Pretty well much I followed this tutorial
    http://multimedia.journalism.berkeley.edu/tutorials/flash/building-flash-templates/adding- video/
    I put a FLVPlayback component on my Flash stage.
    I encoded my videos in the CS3 video encoder and followed the
    settings given in the above tutorial link. I did not resize or crop
    the videos, I set the quality to medium and I gave my videos a name
    prior to encoding it.
    After encoding the film, I highlighted the FLVPlayback
    Component and in the parameters found the content path and then
    linked that to my encoded videos one by one. Then I saved my
    worked, played it in the movie tester and then I exported my swf
    file to my Dreamweaver folder, but I did rename my exported file
    (it is not the same name as my Fla file). Could that make a
    difference? I also put my Flv videos in the same folder as my swf
    file and uploaded them to my server. I put the swf file on my html
    page and then uploaded that to my server. My website shows the swf
    file but the videos do not appear at all.
    I would be grateful to know if you see anything wrong with my
    working process here. Could the renaming of the exported file have
    caused the problem? Or, if an avi video is encoded more than once
    does that make a difference?
    I have other swf files up on line that show video, so dont
    quite understand why this time it is not working.
    For those interested the problem file is at
    http://www.marykingmedia.com/marykingmediafive/index.html
    But a swf file with embedded video that plays fine online is
    at
    http://www.marykingmedia.com/marykingmediafour/index.html
    Id be grateful for help here.
    Thanking you.

    A Web designer can code the page to "force" QuickTime (or its plug-in) to be associated to the file type.
    If QuickTime can handle the format the page code will decide how the file is used.
    The QuickTime Control panel offers the viewer some control over file types. Remove the check mark for .mp3 and relaunch your browser (for the change to take effect).
    In theory the viewer should be able to choose which application or plug-in handles a file format. In practice it doesn't always work that way.

  • Exporting files from Ipad with Itunes 11

    I have a program on my Ipad that I use for my business.  It requires that I import and export files to it.  Well, with the old version of Itunes, I could do it, but now since the 11 upgrade I cannot.  Can somebody tell me how to do it, or did they take away that functionality?

    Actually, I got that wrong!  The best way I have found is to select all CD Tracks, then hit 'bounce cd track' from the file menu.

  • Why are my exported files so small with lightroom 3?

    I have been editing 10 mb raw files and they are no bigger than 2 mb jpegs afterwards.why is that?
    i have been using presets while editing and i reset all settings at some point as my crop tool wasn't working properly.the resolution slider in the export window is at 100%, 240 pixels per inch, and everything else seems to be the way it was before.What am i doing wrong? I used to get much bigger exported files, cca 7-8 mb.

    emi ion wrote:
    I have just imported  raw file from my camera, taken at a full resolution of 21 MP. The raw file has about 23mb and the exported jpeg without the resize to fit box ticked 7 MB. I uploaded the photo on the website and it's still not good enough for a 20''x30'' print. I am not sure if other websites accept other formats than jpeg, as this one doesn't. Not that i want to use them but it was the easiest way for me to check.
    I am not sure if my client will want a canvas print, i am only assuming they might as they did in the past and i want to know what to do if that happens. I read that genuine fractals 6 pro is good, enlarges about 4 times the original size.
    The ppi image resolution required for "handheld" print viewing is higher than that for pictures to be hung a wall and viewed at a distance of  three feet or more.
    The ppi image resolution required for a large canvas print is even lower, with good results obtainable a 100 ppi. Canvas prints have a textured surface that reduces the print resolution and doesn't require as high ppi image file. Print houses use RIP engines that process the image file for both paper profile and printer native resolution. These RIP engines use very sophisticated "upscaling" algorithms, which are as good or better than a photo editing software application such as LR and Genuine Fractals. Because of this it is advisable not to upscale image files to meet a specific printer resolution such as 300 dpi.
    Your 21 mp image files (5184 x 3456) at 100 ppi equates to a 50" x 33" canvas print with edge wrap. Many print houses only accept sRGB profiled JPEG files, but exporting from LR with 100 Quality you create a virtually lossless JPEG image file. You should have no difficulty producing a high-quality canvas print from a well processed 21 mp raw image file up to 50" x 33" in size.
    For enlargements on regular photo paper 150 ppi minimum is required for good results. For your 21 mp image files this equates to 35" x 23," so there should be no problem printing 20" x 30" enlargements for framed wall mount viewing.
    What website gave you the "still not good enough" message for the 20" x 30" print and what is the actual resolution (???? x ????) of the JPEG file you uploaded? Reimport that JPEG file into LR to see the resolution if necessary.

  • Problem importing and exporting files in Vista with 5.0

    When I nsert my 1 GB card for an Adobe upload, it starts the process fine but about 1/2 way through it stops the upload and gives an error message "Cannot obtain all of the files from this device".
    I am able to go ack and select the files which weren't uploaded and the process works fine.
    I seem to be having the samee problem exporting to a removable disk. It only exportsd so many filkes and then it says it can't complete the process.
    This problem is new with my Vista computer and 5.0. I have all the latest updates loaded.

    Chuck,
    When was the last time you check for updates. There is one specifically for
    Vista. Having said that, this doesn't really sound like a Vista issue.
    You might want to post this in the technical issues forum.
    Cheers

  • Export File to PS with Adjustment Brush effects/masks

    This may have been answered before but I searched Google and such with no luck to finding an answer or unsure of what exactly to search as.
    Basically Im curious to know if you edit a photo in Lightroom and use the adjustment brush to desaturate the background of a photo for example, then want to export and do further editing in Photoshop, is it possible to do so and have the adjustment brush effects as a mask or layer of sorts to then easily edit in Photoshop?
    Since the adjustment brush feature in Lightroom automatically creates a mask I thought I would be useful to import into photoshop and still retail the mask somehow making it easy to isolate that area masked out.
    Thanks.

    Thanks, bit of a shame, I do prefer the ease of how LR masks out the areas easily with the brushes.
    I could do it manually in PS but takes some time.
    I've seen a few plugins for layers within LR but I think its an external type app run via LR (OnOne Software makes it) but I doubt it'll do what I want from the looks.

  • Blurry youtube videos, but the exported file is perfect. Help pls!!!

    First off, an exaple of what I mean:
    http://www.youtube.com/watch?v=XyndM70hz6w
    The rendering settings I use with adobe premiere pro cs6
    How is it possible that my video's om youtube get so damn blurry? Btw, i have tried lowering the bitrate but it does not make them less blurry . . . just lowers the overall quality.
    I rlly need help with this, as i am new to the programm.
    Thnx in advance!

    http://www.youtube.com/watch?v=MFzUryUkVqA and http://www.youtube.com/watch?v=TVeH8HFW4sU - Every time the camera makes a turn u can defo see the diffrence in the square boxes and the chat.
    http://www.youtube.com/watch?v=XyndM70hz6w at 0.55 when the window popps up,1.10 it starts and when im flying its horrible.
    Make sure u look at it on a 1080p screen. Maybe im just insanely picky with it but it rlly bothers me when its not perfect, but i know it can be of much better qualy cuz i've seen it on youtube before.

  • How to read a Properties Resource File in KM with Web Dynpro Java

    Hello all,
    I would like to store a resource file in KM and have my web dynpro application read that file at runtime.  Is this possible?  Any examples of how to achieve this?
    I hoping to be able to modify this resource file in KM to easily change certain behaviors in my webdynpro application.

    Thanks Naga Raju Meesala.
    How come all these methods are deprecated...getEP5User
    Also, since I am building a weddynpro DC, what is the proper way to include these jar files as Used DCs?
    Now proceed in the same way with the variable PORTAL_HOME and add the following .jar files:
    u2022 \lib\prtapi.jar The portal runtime APIs
    u2022 \portalapps\com.sap.portal.usermanagement\lib\com.sap.security.api.ep5.jar The user management APIs of the Enterprise Portal 5.0 are deprecated, but still in use in SAP NetWeaver 04
    u2022 \portalapps\com.sap.netweaver.bc.rf\lib\bc.rf.framework_api.jar KM Repository Framework APIs
    u2022 \portalapps\com.sap.netweaver.bc.rf.service\lib\bc.rf.global.service.urlgenerator_api.jar Repository Framework Utility: URL Generator
    u2022 \portalapps\com.sap.netweaver.bc.sf\lib\bc.sf.framework_api.jar Repository Framework: Repository Services
    u2022 \portalapps\com.sap.netweaver.bc.util\lib\bc.util.public_api.jar Repository Framework Utilities

  • Unable to see the imported files in ODI after executing my java program

    Hi,
    I am using the following java code to import the physical topology into ODI11G.
    ===========================================================================
    ImportServiceImpl importService =
    new ImportServiceImpl(pOdiInstance);
    importService.importTopologyFromFolder(importService.IMPORT_MODE_SYNONYM_INSERT_UPDATE,FolderPath, true);
    ===========================================================================
    The above code went through fine while executing my program.But, i can't able to see the imported topology in ODI.
    Can you suggest me how to import the topologies as well as work repository into ODI through Java programming.
    Thanks in advance,
    Ganesh Kesavarapu

    I would do that as a last resort, as it happens to be a client server, I don't think they'd appreciate me needing to reboot a Unix server during the day. Would anyone have any other suggestions?
    I just removed the JSPs from the live server, and refreshed the page and Tomcat could not find the JSPs, so I'm sure I have the correct directory. I then made sure the .java and .class files were deleted from the work directory, uploaded my new files (again) and hit refresh... and yet again I was served the same code as always, when I view source it still shows me the old source code even though the JSP file and compiled java files and class show that the new file should be shown, not the old one.

  • Exporting Files when publishing

    I'm trying to publish a project that consist of two menus.
    One on slide one, and one on slide two. In the menus, there are
    'click boxes' that I have pointed to files. (pdf, htm, etc..) When
    I go to publish, it says the files may require output or something.
    The issue I'm having is when I publish this and place it on cd, the
    paths to all the files is off. The reason is that it's looking to
    the same directory structure that I have on my system I'm creating
    this on.
    Menubuilder allows these files to be output with the
    published item and it works ok. I would use menu builder, but it
    doesn't have the roll over image capability. Therefore, I'm
    wodering if there is a way to do this with a standard captivate
    project. (export files) Thoughts? Any help is greatly appreciated!
    :)

    MenuBuilder does not support roll-over images, as far as I
    know.
    I tried an alternate method-
    Your projext EXE file, along with the files you are not able
    to publish to a CD can be added to an ISO image, and then burned to
    a CD. I tried out AVS Disc Creator,
    and was able to make an ISO image of the files I wanted to
    put onto a CD.
    It's free...
    http://www.avsmedia.com/DiscCreator/download.aspx
    I haven't tried adding a autorun to the iso yet, but I am
    sure that it would work as well.

  • "vaild exported file"

    I downloaded a file from my textbook's website onto my desktop. I went to i-tunes and attempted to import this file, but got a message saying it did not appear to be a valid exported file. Cany anyone help please?

    HELP TOO! My library ALSO disappeared but I didn't do anything. I had not opened iTunes in a while and decided to open it today and ALL OF MY STUFF WAS GONE! Does ANYONE have ANY IDEA how to get it back??????? I'm about to LOSE it... HELP HELP and HELP AGAIN! :o) Please!

  • How do I import old FCP projects that have mysteriously changed to Linux Executable files?  Is it as simple as renaming the files with the.fcp extension?

    I had some FCP projects on an old G3 tower that I finally want to finish. I was able to grab everything, media, etc. to my macbook pro but all of the Final Cut Pro actual movies/projects have turned into "linux executable files" that FCP X won't import.
    I tried googling this issue but didn't really see any good answers. Would it be as simple as renaming the files with the .fcp extension?  I can't recall if my old version (really old) of FCP saves projects as .mov or .fcp files, but I'm assuming I'm not the only person this has happened to.
    Thanks for your help!

    I had some FCP projects on an old G3 tower that I finally want to finish.
    What version of FCP was this? The project files can probably no longer be opened in the newer version of the OS. You could try adding the .fcp suffix, but I don't think it will help for this. Projects files are .fcp.
    Regardless of the version, no legacy FCP projects will import into FCPX.
    Media is a different matter. These are probably QuickTime .mov files. If these are appearing as Unix ececutables, they're probably not recoverable either.

  • Error when exporting to flat file in ODI 11g

    This works ok in ODI 10g. I'm using IKM SQL to File Append on Windows Server 2008 R2
    Getting the following error when exporting to a flat file in ODI 11g: ODI-40406: Bytes are too big for array
    I've seen a couple of threads like this on the forum, but I've never seen an answer to the problem.

    Problem is with the difference in behaviour for the IKM SQL to File Append KM between 10g and 11g.
    Our 10g target file datastore had a mixture of fixed string and numeric columns. Mapping from the source to target was simple one to one column mapping. It generated the desired fixed format flat file; numerics were right adjusted with embedded decimal point and leading spaces. Each numeric column in the generated flat file occupied the exact space allocated to it in the layout. This gave the desired results, even though documentation for the 10g IKM states that all columns in the target must be string.
    When we converted to 11g and tried to run this interface, it generated an error on the "numeric" columns because it was wrapping them in quotation marks. The result column was being treated as string, and it was larger than the defined target once it acquired those quotation marks.
    In order to get 11g to work, I had to change all the numeric columns in the target data store to fixedstring 30. I then had to change the mapping for these numeric columns to convert them to right adjusted character strings (i.e. RIGHT(SPACE(30) + RTRIM(MyNumericColumn),30).
    Now it works.

  • Issues with Exporting files using Lightroom 5

    I bought Lightroom 5 for Mac a couple of months ago and have been using it without any issues, then out of the blue I ran into export problems. Sometimes the exported images wouldn’t have the sharpness adjustments, sometimes it wouldn’t have the noise adjustments, sometimes the saturation or vibrancy, and then sometimes a combination of the above. I know there’s a known issue that effects noise on export if you export on files sizes less than 1/3 of the original size, but mine have always been exported at full size with image quality 70, exporting as jpeg.
    I installed the latest update and that didn’t help. I uninstalled the software and that didn’t help either. I then uninstalled everything completely (including the library) by searching both lightroom and adobe in finder > system files> are included and deleted everything I could find pertaining to adobe lightroom (I didn’t delete everything adobe as I have other adobe products). This didn’t help either. What is really bizarre is that I tried restoring my Mac back to a time when Lightroom worked fine, and this didn't solve the issue, and I've also tried wiping the hard drive and just installing lightroom and this didn't work. This really baffled me.
    What I have also found with Lightroom (and I'm sure it's all somehow linked) is that if I'm working on a file, and either close LR down and re-open it, or go to another file and then back to the one I was working on, initially the image has lost it's sharpening again, but if I click on the sharpen slider (without moving it) the sharpening comes back.
    So has anyone any ideas on what my issues are and how to fix them. I’ve tried the advice on here too [url]http://helpx.adobe.com/lightroom/kb/manually-remove-lightroom.html[/url].
    My workaround at the minute is to use full screen view when I've completed my adjustments and take a hi-res screen shot, but the problem is that the saved images are only approx 1600 x 1000 pixels, which is fine for viewing on my Macbook pro but not good if I want to zoome etc.

    snerkler wrote:
    As I said in my first paragraph I don't think it's the known issue...
    Sorry snerkler - I didn't read closely enough .
    Sounds like you have a different problem - if it's a bug, be sure to report it:
    http://feedback.photoshop.com/photoshop_family/products/photoshop_family_photoshop_lightro om
    Rob

Maybe you are looking for

  • Ho to Generate the Numeric Values Automatically before saving the records

    Hello to everybody, I have a data block naming "BILL" consisting of the following 3 field. 1. Sr_No 2. Bill_Amount 3. Description This Data Block consist 10 records at a time. I want that whenever I insert records in the above data block. Serial No s

  • Lock a table with toplink

    Hello I would like to lock a table with a toplink instruction (ie select for update). How to lock the data ? Thank in advance.

  • How to ran a java application with out console?

    Hi I have developed several applications using java. I'm trying to run them on windows platform. The way I run them now is by openning a CMD window and by typing java -jar myjarfilename.jar This way cmd window remains on windows taskbar/desktop until

  • Build errors : X cannot find itself [solved]

    since going to xorg7 I can't compile anything here's an excerpt from an attempted build of fluxbox checking for X... no configure: error: Fluxbox requires the X Window System libraries and headers. make: *** No targets specified and no makefile found

  • Changing my pc parts?

    i have recently bought and installed CS6 and Lightroom4 on my new PC which cost me 2500$ after picking the parts myself. (i7 3820 Quad 3.60GHz, 16GB 1600MHz, 240GB SSD+1TB HDD, Radeon 7970 3GB, windows 8 atc...) i've expected it to work much faster a