Different file name

Hello all, can anyone pls give me an idea of how to do this:
When i create a file, it has a name that its by default. But if i run my app again the file will be overwritten.
I want to know how to create a new file with the same name, but with a number that makes it different from the previous one.
:-/

River_Plate wrote:
but it will look weird that way.. there has to be a way to have it in a different way.Filenames that contain a timestamp are common -- they don't look weird to me. For example:
something_yyyyMMdd_HHmmss_SSS.txt
so:
soup_20080731_134540_000.txt
But if you want to create files like:
soup000.txt
soup001.txt
soup002.txt
soup003.txt
soup004.txt
You could always look at the files in the directory (File methods listFiles) and analyze their names to see what the next number should be.

Similar Messages

  • How to save a form in a different file name?

    Hello All,
    I have a form which has 7 pages. I have 3 buttons which are for submitting PDF,XML and print button. I do not want to keep SaveAs button.
    What I need : When the user completes all the required fields and clicks on SubmitAsPDF or SubmitAsXML then it will prompt the user to save the form in a different file name. After the user has saved the form in a different file name then it should submit the form to the required mail ID. How to best accomplish it ?
    Thanks.
    Bibhu.

    Hello Niall,
    Thanks for the help. I used a hidden field whose name is "CurrentFileName" then in the docReady event of this hidden field I used the following script.
    this.rawValue = event.target.documentFileName;
    Then in the mouseUp event of the submit button I used the follwing script.
    if(form1.Page1.CurrentFileName.rawValue == event.target.documentFileName)
                             app.alert("Please save this form in a different file name before submitting !");
                             app.execMenuItem("SaveAs");
    But problem is : As the file is saved in a different name the script fires again and again if we click the submit button prompting the user to save the form in a different file name , but the user has already saved it in different file name .How to get rid of it ?
    Thanks.
    Bibhu.

  • Adobe flash error: unable to save the document please try to save it to a different file name

    Hi,
    I am editing few fla files with my Adobe Flash Professional. Suddenly it stopped saving them and is giving me an error; unable to save the document as... please try to save it to a different file name or to a different location.
    i changed the location to save the files, but I still receive the same error.
    Is there any one who knows how to deal with this error?
    Thanks,

    close flash.  right click its icon or start program and click "run as administrator".  save your fla. 
    if that fails: restart your computer, create a new directory on your desktop and save a test fla (eg, named test) to that new directory.  any problem?

  • IDoc to File with different file name and data based on the IDoc header dat

    Hi,
    I got a requirement to implement IDOC to file senario.  In this the Converted file should have the file name and file content based on IDoc Header data.  Means If one of the IDoc header field value is
    'A'  - then the file name recieved by reciever system should be 'A.txt' and with the columns A  B  C  D  F.
    'B'  - then the file name recieved by reciever system should be 'B.txt' and with the columns C  D  F.
    In both the case IDoc message type is same.
    Please suggest me what i need to do to achieve this.
    Thanks in Advance. ...
    Regards
    Sri

    Hi,
    As per my requirement, we need to create one file for each IDoc based on IDoc header data. SAP program generates 10 IDocs for each run. All 10 IDoc's message type is same.  Each IDoc has one header record with the file name. Base on the  name in the IDoc header record, file needs to be created with different columns and file name. Means..
    IDoc 01- Header Description contains 'A' - than file will be generated should have name as 'A.txt' and columns 'parent'  'child' 'descripion'.
    IDoc 02- Header Description contains 'B' - than file will be generated should have name as 'B.txt' and columns 'Name' 'Department' 'Description'.
    IDoc 10- Header Description contains 'J' - than file will be generated should have name as 'J.txt' and columns 'Order No'  'Materail' 'Description'.
    Hope this will give more clarity on my requirement. Please let me if you are still not clear on requirement.
    Thanks for your all help..
    Thanks & Regards
    Sreeni

  • Mutiple sender files and receiver files with different file names

    Hi All,
    Following is my scenario: File (FTP) --> XI --> File (NFS actually SAP system)
    I have 5 source files like ABC<b>1</b>_DateTimeStamp, ABC<b>2</b>_DateTimeStamp, ABC<b>3</b>_DateTimeStamp, ABC<b>3</b>_DateTimeStamp and ABC<b>3</b>_DateTimeStamp.
    I can use single sender file FTP adapter with file name ABC* which picks up all 5 files, but can I use single receiver adapter to create 5 different files with the following file names: ABC1, ABC2, ABC3, ABC3 and ABC3 ?? And last 2 files (ABC3 and ABC3....same name) should be created after 30min and 60min of first ABC3 file. We have to do this because we have jobs scedule on SAP side with variants having file names.
    Is it possible to achieve using single sender/receiver file adapter??
    If not any suggestions how to do this scenario?? 
    Thx
    Navin

    Navin,
    I doesn't know whether its feasible for you or not. Please see the below option
    Create 3 Sender  comm.channels and 1 Receiver comm.channel. In Sender /Receiver file adapter check the Adapter Specific Message attributes.
    I'm suggesting the soln using BPM.
    In IR, Create 3 Outbound Interface (Abstract) and create 1 Inbound Interface(Abstract).
    First 2 comm.channel and 2 Oubtound interface refers to file 1 & file2 respectively.
    The 3rd comm.channel and 3 Outbound interfaces refers to file3 & file4& file 5 .
    Please see the BPM design.
    http://www.flickr.com/photo_zoom.gne?id=698877499&size=o
    Note : Navin the above suggestion is my thought, I think it will work. U can juz give a try.
    Best regards,
    raj.

  • Script to SaveForWeb with different file name

    Can someone direct me to a script that can take the file and SaveForWeb in different versions and append different text to the filename?
    For example, say I've got a file called "myPhoto".  I need a script that saves it as  JPEG called "myPhotoPOWERPOINT" and a GIF called "myPhotoWEB"
    Is this possible?
    Thanks to everyone for your time

    This script will export the activeDocument as a jpg and gif
    function exportSFWJpg( doc, saveFile, qty ) {
         var exportOpts = new ExportOptionsSaveForWeb( );
         // see guide for other options
         exportOpts.format = SaveDocumentType.JPEG
         exportOpts.includeProfile = true;//default false
         exportOpts.quality = qty;
         if ( saveFile.exists ) saveFile.remove( );
         doc.exportDocument( saveFile, ExportType.SAVEFORWEB, exportOpts );
    function exportSFWGif( doc, saveFile, qty ) {
         var exportOpts = new ExportOptionsSaveForWeb( );// default format is gif
         // see guide for other options
         if ( saveFile.exists ) saveFile.remove( );
         doc.exportDocument( saveFile, ExportType.SAVEFORWEB, exportOpts );
    var doc = activeDocument;
    var docPath = decodeURI( doc.path );
    var docName = decodeURI ( doc.name );
    docName = docName.match( /(.*)(\.[^\.]+)/ ) ? docName = docName.match( /(.*)(\.[^\.]+)/ ) : docName = [ docName, docName, undefined ];
    var saveName = docName[ 1 ];
    exportSFWJpg( doc, new File( docPath + '/' + saveName + 'POWERPOINT.jpg' ), 80 );
    exportSFWGif( doc, new File( docPath + '/' + saveName + 'WEB.gif' ) );

  • How to replace a sub vi that is used in many main VIs with another sub vi under a different file name without repeating the replace vi operation?

    Hello,
    I am converting a LV5.1.1 llb to LV7.1 that contains serial sub VIs ("Serial Port Read.vi", "Serial Port Write.vi", and "Bytes at Serial Port.vi") that need to be replaced with the newer VISA serial sub VIs ("VISA Read.vi", "VISA Write.vi", and "VISA Bytes at Serial Port.vi").  The older serial sub VIs are used on many different main VIs under the same llb, and I want to be able to replace all the older serial sub VIs with the equivalent VISA sub VIs in LV7.1 without repeating the same replace VI task on each main VI.  Please advise if it can be done in LV7.1 and how?
    Thank you so much for your help,
    Valen

    If you have the old serial VIs in the llb, make a copy of it and delete them. Then, when you open the top level VI in 7.1, LabVIEW should replace them with compatibility VIs of the same name but using VISA.

  • Different File Name in Finder vs. File Name in Console?

    I'm trying to rename the Library/Internet Plug-Ins folder.
    As root, I use mv in Console. I do ls and it shows me the new name.
    Finder couldn't care less. Finder keeps showing "Internet Plug-Ins".
    I could see OSX not letting me change the name of an "essential" system folder in the first place -- but how could Unix be showing me a different name than the Finder?

    Oh just ignore me -- I wasn't typing sudo every time...

  • Question about different file name send to different receivers?

    Hi, Gurus,
    my senario:
    in ftp server there are many files, which are either .doc or .xls. 
    All .doc must be sent to e-mail address departmentA(a)companyname.com.
    All .xls must be sent to departmentB(a)companyname.com.
    I use Mail Package and keep attachment, without ASMA.
    In Mapping I create UDF as below:
    DynamicConfiguration conf = (DynamicConfiguration)container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","FileName");
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/Mail","THeaderTo");
    String ourSourceFileName = conf.get(key);
    String ourMailTo = "";
    if (ourSourceFileName.equals("*.doc"))  {
           conf.put(key1,"departmentA(a)companyname.com");  }
    else  {        conf.put(key1,"departmentB(a)companyname.com");  }
    return ourSourceFileName;
    But i got error message from integration engine:
    Runtime exception occurred during application mapping com/sap/xi/tf/_MM_File2Mail_Dynamic_; com.sap.aii.utilxi.misc.api.BaseRuntimeException:Invalid byte 2 of 2-byte UTF-8 sequence.
    What can i do? thanks for any kind of suggestion!
    Rene
    Edited by: Kefei Dong on Jul 16, 2009 10:27 AM

    Just overwrite the filename in the WSDL file that was generated

  • Problems copying iTunes folder to an external hard drive - "The operation can't be completed because the item FILE NAME is in use"

    Hi,
    I have been trying to back up my iTunes folder from my MacBook hard drive over to a new LaCie external hard drive.  However, whenever I try to do it at some point during the copying I keep getting the warning "The operation can’t be completed because the item FILE NAME is in use".  Each time I have tried it, it is always a different file name that comes up and at different points of the copying.  Following the warning, the copying stops and cannot be restarted.
    I tried copying the iTunes folder to another Lacie external hard drive that I have, and it worked fine so I am guessing that it maybe something wrong with the hard drive.
    I've been trying various approaches all day and can't seem to get anywhere with it - all very frustrating, so any help would be much appreciated!
    Thanks.

    If you don't have other backup data on it, reformatting external drive could solve the problem.

  • File name format of rotated access log

    Hi,
    I'm using wls5.1sp9 on Solaris.
    Is it possible to specify a different file name format of the rotated http access
    logs?
    Instead of getting files named access.log0001 and so on, I would prefer access.log.<date>
    or some other custom format.
    Best regards,
    Torleif Galteland

    Hi,
    Thanks for your response. But I have another query. The name of the file as per your reply is like UsageReport.xls correct? Now my query is, should it contain some date,account id/orgid etc associated for that usage. The reason for my query is that if MSP
    downloads the usage for different orgs having same bill date then it would conflict with the different usage files.
    Thanks And Regards,
    Sumanta Saha

  • Dynamic file Name generation

    Hi Experts,
      i have the requirement
    I need to extract some records from Database (Scenario is Database to file) and we need to put it into file.
    then i need to change the file name based on certain conditions and send it to relevent file server which are globally located across the world.
    My Doubts are :-
    1- After extracting the records from Database From where i can get file name?? Can i get the file name from SXMB_MONI. If yes then How??
    2- Now I got the file name then i need to change this file name into different file names (Dynamically) based on some conditions to send it to different file servers. Can i do it in my mapping Or i need to write a module for it.??
    Thanks in Advance
    Regards Prajwal

    Hi Naluvala,
    Based upon your condition you can directly set the file name using this UDF:
    DynamicConfiguration conf = (DynamicConfiguration) container
        .getTransformationParameters()
        .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create(
        u201Chttp://sap.com/xi/XI/System/Fileu201D,
        u201CFileNameu201D);
    String valueOld = conf.get(key);
    if (valueOld != null) {
        String valueNew = valueOld.replaceAll(u201Cinputu201D,u201Doutputu201D);
        conf.put(key, valueNew);
    Instead of using get function to populate the valueOld, you can use your own logic.
    Regards,
    Sanjeev.

  • File name of Document stored through OAAD

    Hi Experts,
    We are using tcode - OAAD to store any document against employee.
    Following are the inputs provided to the system while storing the
    document.
    1. Business Object - The value used in our case is "PREL"
    2. Document type - The value used in our case is "HRIRESUME"
    3. Personnel Number
    4. Infotype number
    5. Date of origin
    6. File path - path from the presentation server
    We can display the document using tcode PA20.
    Every time the system generates a different file name.
    We are not able to find out the actual file name which was specified
    while entering the file path.
    Kindly help ......
    Regards,
    Santosh.

    Hi Santosh
    Please review below link if this helps
    http://help.sap.com/saphelp_47x200/helpdata/EN/dc/92d8345388482be10000009b38f83b/frameset.htm
    Best Regards

  • Sender File Adapter- Incrementing the counter in file name

    Hello,
    We have a requirement to read a different file name with every read. Every subsequent file would have a numeric counter updated when we receive it, we need to read that file as the directory would hold the previous files as well.
    File structure :- EP<counter>.txt ; so first file would be EP001.txt, next one would be EP002.txt.
    How could i do this in Sender file adapter, as there is no variable substitution available like receiver file adapter.
    I cannot use wild card characters as the directory would contain previous files as well and we ned to pick the latest file.
    Regards

    Hi,
    >>How could i do this in Sender file adapter, as there is no variable substitution available like receiver file adapter.
    Yes true this is not available in sender channel
    >>I cannot use wild card characters as the directory would contain previous files as well and we ned to pick the latest file.
    You can use EP* as the filename and use processing mode as Set to Read-Only
    Regards
    Suraj

  • File Name and File Content  not gettinng passed from Proxy to Business Serv

    Hi All ,
    I have a requirement in OSB , where i need to pick the file from remote Source and FTP the files to Remote Target .Below are the steps which i did to achieve this.
    1.Created a FTP Adapter in JDeveloper to Get the files from Source and a FTP Adpater to Put the files to Target.Inboth the adapters i have choose 'Shema is Opaque'
    2.Imported the wsdl and jca file to OSB
    3.Generated Proxy Service (PS ) and Business service (BS) out of Step 2
    4.I edited the Message flow such a way that , the PS is routed to invoke the BS
    Aslo i assigned $inbound/ctx:transport/ctx:request/tp:headers/jca:jca.file.FileName to a variable 'FileName' in PS
    and in BS service i passed $outbound/ctx:transport/ctx:request/tp:headers/jca:jca.ftp.FileName = 'FileName'
    When i tried to activate my session , the file that is getting written to the target has 0 byte.Also , the file name is also not getting passed from PS to BS
    Can some one help me with the steps on how to use the Xpath , so as to pass the file name and file body from proxy servive to business service.
    Thanks
    John

     I search multiple shares to find a common file name then create a single output file. I will be doing this search and file creation
    for 5-10 different file names. If there is a better way .. certainly open for suggestions. It's working but having issue with
    the cmd file for every file and folder I check. It puts this error out for each run of the process.
      Error message in LOG file:
    Get-ChildItem : Cannot find path 'F:\powershell\-SearchFor' because it does not exist.
     Thanks.
    I tried your code with little changes and saved in Temp folder.
    My CMD file has the below code
    PowerShell C:\Temp\Untitled1.ps1
    It worked.
    Regards Chen V [MCTS SharePoint 2010]

Maybe you are looking for

  • Can someone explain the use of a hashtable in java?

    can someone explain the use of a hashtable in java?

  • Connecting R/3 source system as BW source system type

    hi, I have just noticed that on my clients system I work now source system SAP ERP is connected as source system type SAP Business Information Warehouse. Is it ok to do it like that? Should not it be connected as SAP System from release 3.0E (Automai

  • BMP in EJB 3.0

    I've been on the google for a few days now and haven't found one single notion on bean-managed persistence in EJB 3.0 specification. Even the official specification PDFs don't mention it :( Help! I need BMP! Does anybody know what's the situtation in

  • Kindly suggest an alternative to Oracle for all our SAP BWinstallations

    Can any body tell me what are all the database which shupports SAP BW(OLAP Environment) and SAP SUPPORT provides support. The following are the things which i would like to get as information. Kindly help as i need to present this to my Management. 1

  • JMSClientExceptions:055142 when connecting to external IBM MQ Topic

    I am attempting to send a message from my application residing on WL 10.3 to a topic on a IBM MQ 7 process running on another server. The application is Java/Spring, and the connection is actually working because I can debug it just before the send m