Copy & rename ident. file to new Loc&Cat in OpenBatch folder - dynamic

I am in the process of writing an Event script to deal with the folllowing situation:
During an automated upstream process certain files are dumped, prenamed (per naming convension) into the OpenBatch folder ready for standard batch upload the next morning.
The Event Script is designed to check if any of the qued files meet certain Loc, Cat & Per criteria, and if any file matches the criteria it should be copied to the end of the same OpenBatch file que, and then renamed to a different predetermined Loc, Cat & Per. This is based on a standard serial batch load setup.
I have chosen to acvtivate this process after each file reaches the AftLoad event, where the strLoc, strCat & strPer information is already captured in the AftLoad arguments.
Here is my script:
Sub AftLoad(strLoc, strCat, strPer, strTCat, strTPer, strFile)
‘ FDM EVENT Script:
‘Purpose: This script creates a copy of a specific file and
‘ then renames it according to predetermined criteria.
‘Declare local variables
     Dim fso
     Dim strPath
     Dim iFleCnt
     Dim fld
     Dim fle
     Dim strAlpha
‘Declare file system object
     Set fso = CreateObject("Scripting.FileSystemObject")
‘Count the number of files in the folder
     strPath = "C:\Hyperion\FDMData\Test\Inbox\Batches\OpenBatch"
     Set fld = fso.GetFolder(strPath)
     Set fle = fld.Files
     iFleCnt = fle.Count
     iFleCnt = iFleCnt + 1
‘Set the next character for the last file in the batch
     strAlpha = "abcdefghijklmnopqrstuvwxyz"
     strAlpha = MID(strAlpha,iFleCnt,1)
‘Destroy file system object
     Set fso=Nothing
‘Declare file system object
     Set fso = CreateObject("Scripting.FileSystemObject")
‘Test whether file meets duplication criteria
     If strLoc = "LOCATION1" And strCat = "SCEN1" Then
‘Then test if it is a YEND instance          
          If Left(strPer,3)="Jan" Then
               fso.CopyFile strPath & "\" & strFile , strPath & "\" & strAplha & "@LOCATION2@SCEN2@" & MID(RIGHT(strFile,17)1,11) & "RM.txt", False
‘...Or if it is a HALFYEND instance
          ElseIf Left(strPer,3)="Jul" Then
               fso.CopyFile strPath & "\" & strFile , strPath & "\" & strAplha & "@LOCATION2@SCEN2@" & MID(RIGHT(strFile,17)1,11) & "RM.txt", False
          End If
     End If
‘Destroy file system object
     Set fso=Nothing
End Sub
Have I done this right?
Please let me know if I’ve missed anything…or fallen off the edge here in attempting this.
Urgent feedback will be treated with devotion!
Cheers
R
Edited by: 911307 on Feb 2, 2012 3:54 AM

Hi,
The displayname property is being copied from the original resource. If you want, you can change the property after you copied the resource:
IPropertyName propName =
     PropertyName.createDisplayname()
IProperty prop = new Property(propName, "NewDisplayName");
if (res.isVersioned()) {
  IMutablePropertyMap mutPropMap = res.getProperties().getMutable();
  mutPropMap.put(prop);
  IContent resContent = res.getContent();
  if (!res.isCheckedOut()) {
    res.checkOut();
  res.checkIn(resContent, mutPropMap, true);
else {
    res.setProperty(prop);
Kind regards,
Avishai Zamir

Similar Messages

  • Where to copy existing XCM file for new b2c project?

    Hi,
    I have created one "b2c_myproject" application by using build tool. I have one b2c application running. I want to copy it's XCM setting to my new project.
    I do not want to do setting by seeing each value in XCM. Any one has a Idea from where I can copy existing XCM files?
    Thanks.
    Ashish Patel.

    Hi Ravi,
    As per your instruction I copied XCM folder into desired location. But when I am accessing that xcm page like
    "http://localhost:50000/b2c_myproject/xcm/admin/init.do"
    But I can not see default setting which I have made to my original b2c applicaiton.
    there are no XCM configuration under customer section.
    pl. let me know where I am making mistake.
    What I want actully, I want to see my basic xcm setting in my b2c_myproject so do not have to do basic xcm setting.
    Thanks for your reply and helping me.
    Ashish Patel.

  • Copying/renaming a file w/a date/time stamp

    Java virgin here.....
    I am sure there is a post out here on this subject somewhere...
    I am trying to rename a file using the date and time EG: MYFILE05031223.txt
    Where 0503 is the date and 1223 is the time.
    Thanks....

    Thanks so much for your help...but seeing how I am a fullfledged newbie
    perhaps you can assist as to why this code will not compile...
    import java.io.*;
    import java.util.*;
    public class rename{ 
         public static boolean renameFile(File f) {                                                  
    DateFormat df = new SimpleDateFormat("MMddHHmm");
         String timestamp = df.format(Calendar.getInstance().getTime());     
         return f.renameTo(new File("Barcoden" + timestamp + ".txt")); }
    I am getting the following error msg's....
    C:\jdk1.3.1_08\bin>javac c:\JavaCode\rename.java
    c:\JavaCode\rename.java:17: cannot resolve symbol
    symbol : class DateFormat
    location: class rename
    DateFormat df = new SimpleDateFormat("MMddHHmm");
    ^
    c:\JavaCode\rename.java:17: cannot resolve symbol
    symbol : class SimpleDateFormat
    location: class rename
    DateFormat df = new SimpleDateFormat("MMddHHmm");
    ^
    2 errors

  • Time machine copied my old files over new ones.

    Sometimes the Macbook Pro would't load the desktop. Other times it won't load the password window. The backup drive booted up. I ran Norton anti-virus but found nothing.
    The disc utility found the disc OK. But repairing permissions won't run. DiskWarrior gave the dreaded error 9972, which means any I one of 10 things could be wrong.
    I noticed the Chrome icon had changed to blue, the color when Chrome first came out. Time machine had "updated" my files and apps back to 2009. What the ****. Have I lost all my work since I last backed up my disc in 2009? I had DiskWarrior rebuild the directory. But the disc still won't boot.
    What caused time machine to load the backup over the new files?

    jquin6 wrote:
    The backup drive booted up.
    Huh? What do you mean? Time Machine backups are not bootable.
    I ran Norton anti-virus but found nothing.
    That's well-known to wreak havoc on OSX. It may well be the cause of your problems. Uninstall it immediately. You may need help to do that, as it's also notoriously hard to get rid of all the bits it leaves behind.
    Search this forum for Norton and you'll see what I mean, and find a link to an uninstaller.
    Also see Thomas Reed's [Mac Virus Guide|http://www.reedcorner.net/thomas/guides/macvirus].
    Have I lost all my work since I last backed up my disc in 2009?
    You haven't backed-up since 2009?
    I had DiskWarrior rebuild the directory. But the disc still won't boot.
    Do you mean your Mac won't boot from the internal HD?
    What caused time machine to load the backup over the new files?
    Exactly what did you do? Did you tell it to restore that 2009 backup? If that's what you told it to do, that's what it did.
    Please clarify, with details.

  • Upgrading stock hard drive: how to copy lion and files to new drive

    Per above, I'm planning to replace my stock 5400rpm drive with a new Western Digital Scorpio Black drive this evening.  I want to transfer all my files, folders, and applications from the old drive to the new one.
    I have an external drive, which has my Time Machine backup.  Can I use that backup to just restore everything after physically installing the new WD? Mor is there a better way?

    I would get an enclosure in which to place your old drive. Then boot from the external drive, partition and format the new drive then clone the old drive to the new one:
    Drive Preparation
    1. Open Disk Utility in your Utilities folder.
    2. After DU loads select your hard drive (this is the entry with the mfgr.'s ID and size) from the left side list. Note the SMART status of the drive in DU's status area.  If it does not say "Verified" then the drive is failing or has failed and will need replacing.  SMART info will not be reported  on external drives. Otherwise, click on the Partition tab in the DU main window.
    3. Under the Volume Scheme heading set the number of partitions from the drop down menu to one. Click on the Options button, set the partition scheme to GUID then click on the OK button. Set the format type to Mac OS Extended (Journaled.) Click on the Partition button and wait until the process has completed.
    Clone Lion using Restore Option of Disk Utility
    Boot to the Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Select Disk Utility from the main menu then press the Continue button.
    Select the destination volume from the left side list.
    Click on the Restore tab in the DU main window.
    Check the box labeled Erase destination.
    Select the destination volume from the left side list and drag it to the Destination entry field.
    Select the source volume from the left side list and drag it to the Source entry field.
    Double-check you got it right, then click on the Restore button.
    Destination means the new drive. Source means the external old drive.

  • How to save a copy of a file to different location using jfilechooser

    hi, this is ravikiran,
    In my project there is a situation where when a user clicks on some button, a copy of a file(which is initially in my project folder) must be saved to a location specified by the user.
    I have no idea how to do this using JFileChooser.
    help me,
    thanx in advance

    JFileChooser lets you choose a file. Once it's done you will have to program the copy function with womething like :
         public void copyToDir(String fileSource,String fileDest) {
              try {
                   FileChannel srcChannel = new FileInputStream(fileSource).getChannel();
                   FileChannel dstChannel = new FileOutputStream(fileDest).getChannel();
                   dstChannel.transferFrom(srcChannel, 0, srcChannel.size());
                   srcChannel.close();
                   dstChannel.force(true);
                   dstChannel.close();
              } catch (IOException e) {
                   e.printStackTrace();
         }

  • Running a Batch by checking File in OpenBatch folder instead of scheduling

    Hi All,
    We have  requirement to run a Batch file whenever it is available in OpenBatch Folder. It is not available at any particular time intervals so we can not schedule it.
    Can this be achieved by using some script in FDM? Or do we need to write some VB script to check the OpenBatch folder for file and then call the batch using Upshell?
    Any inputs are appreciated.
    Thanks in advance.

    that's how it is run on the current (and previous) client sites and the system administrator just enables / disables for the appropriate business days or in some cases they jut leave it polling
    the .net option i played about with was the FilesystemWatcher class, and although it did the job, i took the view that it was an extra bespoke bit of functionality that needed to be managed / monitored and in the end did not really provide any benefits over the task manager. At least with Task manager, it is part of the application and easy to control if there are issues and you wish to stop / start the batch process (especially when testing etc or production problems arise).
    If you do a search on the internet i am sure you will find various examples in different progam languages that may be of assistance to you.    

  • LOOOOOONG pauses in Windows Explorer with file copy, rename, new folder, etc.

    I am using Windows 7 64-bit pro and I am experiencing horribly long pauses in Windows Explorer on very simple file operations, such as renaming a file, copying a file, creating a new folder, etc. Here is an example:
    1. Open a folder in windows explorer, e.g. My Documents
    2. Select a file
    3. Hit F2 and enter a new name for the file, then hit ENTER to save the name
    4. Windows Explorer now shows the wait cursor and becomes completely unresponsive, sometimes for MINUTES.
    This is crazy. I read somewhere it may be due to shell extensions -- another post specifically called out MagicDisc, but I uninstalled that and still have the problem. After a fresh reboot the problem usually is not there immediately, but always comes back eventually.
    Anyone have any ideas?

    Hi Lex3001,
    I would like to confirm what are the results in Safe Mode and Clean Boot?
    I also would like to suggest you run ShellExView again and disable some shell extensions to check the issue.
    Run ShellExView
    =================
    1. Launch ShellExView again and scan the computer.
    2. Press "Ctrl" on the keyboard and click all items which are marked in pink in the list.
    3. Choose "File" then "Disable Selected Items".
    4. Quit and restart the computer to check the Windows Explorer issue again.
    Does it work?
    In addition, I also would like to suggest you create a new user account to check the result
    Regards,
    Arthur Li - MSFT

  • HT2548 how do i copy the domain file from OS 10.4 to a lion OS computer?  I made a copy of the domain file and copied it to my new computer, but it doesn't open in iweb when I double-click on it.

    How do I import an iweb domain file from an ibook (OS 10.4) to an imac (OS 10.73)?
    I copied the domain file from my ibook to my imac, but when I double-click on the file, it doesn't open in iweb. 

    In Lion the Library folder is now invisible. To make it permanently visible enter the following in the Terminal application window: chflags nohidden ~/Library and hit the Enter button - 10.7: Un-hide the User Library folder.  Then place the domain file in your Users/Home/Library/Application Support/iWeb folder.
    To open your domain file in Lion or to switch between multiple domain files Cyclosaurus has provided us with the following script that you can make into an Applescript application with Script Editor. Open Script Editor, copy and paste the script below into Script Editor's window and save as an application.
    do shell script "/usr/bin/defaults write com.apple.iWeb iWebDefaultsDocumentPath -boolean no"delay 1
    tell application "iWeb" to activate
    You can download an already compiled version with this link: iWeb Switch Domain.
    Just launch the application, find and select the domain file you want to open and it will open with iWeb. It modifies the iWeb preference file each time it's launched so one can switch between domain files.
    WARNING: iWeb Switch Domain will overwrite an existing Domain.sites2 file if you select to create a new domain in the same folder.  So rename your domain files once they've been created to something other than the default name.
    OT

  • I tried to rename a file, it gave me an error message (can't remember the number - 43??) and then the file disappeared from the original folder. When I do a search, the file comes up under the new name, but it does not show a path, and even though preview

    I tried to rename a file, it gave me an error message (can't remember the number - 43??) and then the file disappeared from the original folder. When I do a search, the file comes up under the new name, but it does not show a path, and even though preview shows the contents, I can't open the document (Powerpoint) and I can't move the document. I tried "Copy" and paste but it doesn't work. I tried "Share" with Airdrop and iChat, but the file is inaccessible. When i try to rename the file, it says the filename is too long.
    When I try to open it, it says the alias is not good, and asks if I want to fix the alias. I'm afraid to do that and lose all access to this document.
    Right now, it feels like a ghost document - it is on the computer intact, but it is in an undisclosed location and inaccessible.
    Please help!!

    I was able to resolve this by repairing permissions, even though no permissions error was listed specifically for that file.
    I could also have recovered it through Time Machine, but I'm interested in knowing how not to have this happen again!
    I was afraid of rebooting and possibly losing track even of the ghost.
    I did not try EasyFind - I'll keep that in mind next time.
    Thanks for all the comments.

  • Error 8062 when I try to copy or move files on my macbook: "This operation could not be completed because an unexpected error occurred (error code -8062)". Can even not install new software now!!

    Since a few days when I try to copy or move files on my macbook, I often get an error message saying "This operation could not be completed because an unexpected error occured (error code -8062)". And then it just quits the copy or move.
    I searched a lot on the internet, but only found solutions for cases you cannot empty the trash due to this issue.
    I tried those solutions for my trash and that helped after some trying.
    However, I still have the problem with copying and moving files.
    I even cannot install new software now, as it has to copy itself to the programs-directory, and gives the same error-message.
    Who can help me??
    Cannot seem to find any info on it on the support-forums or elsewhere.
    My user-account is administrator, I use a 13" Macbook Aluminium (Late 2008). Mac OS X 10.6.8 CPU 2Ghz Intel Core Duo, RAM: 4GB 1067 MHz DDR3.
    Any help would be greatly appreciated...
    Otto

    Tips I received so far (thanks to A-Mac via Twitter http://www.a-mac.nl and Remco Kalf http://www.remcokalf.nl/)
    - make sure you have at least 10% of your harddisk in free space (I had only 5%).
    - do a PRAM-reset (http://support.apple.com/kb/ht1379)
    - perform a hardware test (http://support.apple.com/kb/HT1509)
    - make a complete backup (with for example Carbone Clone Copier, see http://www.bombich.com/)
    - after complete backup: use diskwarrior (boot from Diskwarrior DVD, first perform diagnostics, then perform "Rebuild" which rebuilds your file directory).
    So far I only cleared up some space on my HD, and already the problem occurs less.
    Still, I will go through the other tips too.
    (will post progress)

  • I backup my iphone on my pc and copy backup file into drive D then i setup new OS on my pc. after that i copy the backup file into itunes backup folder but itunes can't find the backup file to restore my iphone. how can i restore my iphone?

    i backup my iphone on my pc and copy backup file into drive D then i setup new OS on my pc. after that i copy the backup file into itunes backup folder but itunes can't find the backup file to restore my iphone. how can i restore my iphone?

    Don't you just love changes in interfaces?
    I found the answer to my question.
    When you attach a device (iPhone, iPad) to your Mac, in iTunes 12 in appears as a tiny icon in the second "row" of the iTunes display. Click the icon and the familiar iTunes display for the device appears. From there, on the Summary screen, you can see the dates of the backups of the device (iCloud and backup to the computer). You can also use the button to backup to the computer.

  • I can't get download to work - it will not copy the mp3 file to my chosen location (as set in tools/options) - it gives me a new window with a player - no dwnlo

    I am running windows xp sp2 and I have set my dowload location under (tools/options), but when I select an MP3 file to download, firefox does NOT copy the file to my chosen location on my HD - instead, it opens up a new window with a makeshift "player" and begins loading the player with the MP3 file. The problem is that I have no idea where on my system firefox has copied this file to, so, I cannot leave and come back later and play this MP3 file using winamp. I have to listen to it right then or lose it - if I close that new window (with that puny little "player"), then I lose the download, wherever firefox put it on my PC (I got no idea where it is). This is all under firefox 25.0
    I am also running FIrefox 12.0 on an older windows 2000 machine and that works perfectly - I can download any MP3 file I want, and firefox 12.0 (on win2k, sp4) downloads it to my chosen location (on my HD), and it gives me the download window so I can watch its progress and have some control over pause, and resume, and, when it is done, the download window offers me the option to "open containing folder" so I can make sure it got to where I wanted it. In other words, Firefox 12.0 on WIn2k, sp4 works better than firefox 25.0 on winxp sp2!!!!! What gives? I went through and set up my options for XP just like I did with Win2k and it all looks good, but firefox 25.0 just ignores my chosen location and always defaults to give me that makeshift player and I am not able to actually copy the mp3 file to my harddrive - it makes firerox 25.0 almost unusable since downloading mp3 files is a big part of my firexfox use - please help - I am not able to upgrade windows at this time, and, since firefox 12.0 still works fine on win2k, I can't understand what happened at firefox?

    Phillipp,
    I tried it again using "save link as", and this time it actually worked! I just now downloaded several more using the "save link as" option, and it works perfectly. Thanks. Problem solved.
    Littleberry

  • I was able to copy all my files from my Time Capsule, but that is all they are...files. How do I get my new Mac Mini to emulate my other Mac?

    I was able to copy all my files from my Time Capsule, but that is all they are...files. How do I get my new Mac Mini to emulate my other Mac?

    Doggiemommie,
    Copying files is not a good idea.
    The "other Mac" was backed up onto Time Capsule using the Time Machine. On your new Mac you should restore the old user - rather than copy files manually.
    This usually happens during the initial setup of the new computer or you can do it later using Migration Assistant.
    Please note, it is possible to damage backup file on the Time Capsule when you browse it and copy files manually.
    Hope this explains.
    TZ

  • HT1386 I lost my profile on my PC and I copied everything over to a new profile.  I installed Itunes and copied over all my music files and now it says that sync's but it is not getting a new download.  what do I do?

    I lost my profile on my PC and I copied everything over to a new profile.
    I uninstalled Itunes and then reinstalled the latest version.
    I added all of my music files to the itunes library
    I tried to sync,  but my latest download is not transfering from Itunes to the Ipod.
    what do I do now?
    Help Please !!!!

    Do this. If all the synced media like apps and music are alread in the the iTnunes library just backup the iPod and restore from that backup
    iOS: How to back up and restore your content
    Syncing to a "New" Computer or replacing a "crashed" Hard Drive: Apple Support Communities

Maybe you are looking for

  • Is it possible to display the static numerals as Hindi?

    Trying to generate a report using XML Publisher, the report composed of two columns. Need to display the numerals in English language coulmn in Arabic numerals and the numerals in Arabic language column in Hindi numerals. Currently they both appear a

  • How to delete the delta queue in the ECC

    Hi everyone! After I tryed to save a new Infopackage and I have the error : (Deltas already loaded for request REQU_41Q82WJLR9AZCE9ZMKQLVG3RG init. selection; no 2. init Message no. RSM1071 Diagnosis Deltas have already been loaded for the init. sele

  • AS 2 Conundrum

    Happy Holidays everyone, I've looked at this problem a hundred times but cannot seem to see what's causing my problem.  I am looking at this ActionScript in my Flash file: import mx.transitions.Tween; import mx.transitions.easing.*; var tween_type =

  • Sun ONE Portal Server 6

    Hi again, I have a problem with my Portal. I have already installed the Portal Server 6. The sample portal is up and it's working good, but I can�t edit the content because I couldn�t found the tool for modify the sample portal. My Portal Server is r

  • Receive Pipeline In Decoder Stage to Extract Single Or Multiple Files From A Zipped Folder In Biztalk Server 2010

    Hi, I need help in developing a customized pipeline for the Decoder Stage. Requirement : Extract single or multiple files from a zipped folder with any format and extension (X12/EDIFACT/Flat/XML) and send to Disassemble stage for further action. Need