File name + date

Hi,
I create a file writing;
File file = new File("C:\\simba\\color\\names.txt");
but then I want to create another one and name it "names" plus todays date. How do I do that?
I use the GregorianCalendar and get the date but how do I add it so that my files name shows as; names032904?
/b

well you need to convert the date to string if it's not already done. Then you would just concatenate the file name and the date.
if yourdate is the date you get in string form, you would do:
string filename = "names"+yourdate+".txt";

Similar Messages

  • Inserting automatic file name, date and time in Illustrator CS3?

    hello all,
    is there an option in Illustrator where you could automatically insert inside your file the file name, date and time where it was last created or modified, etc.
    I found this option to exist in InDesign, but could not find the same menu in Illustrator. I am using CS3.
    help?
    thanks a bunch.

    Mario,
    would you please be so kind to include a reference on your site about the script? As far as I can see, the PutDateandTime.js you are providing here is a copy or a slightly modified copy of the original script that Wolfgang Reszel has provided on our site for about four years.
    It is okay that the script is available on your site, but please not without a reference. Thanks.

  • Dynamic file name (Date) in Receiver File Adapter

    Hi,
    can any one tell me how to create outbound file name with receiver file adapter in format like Name_22-08-2006.dat. I need from a current Date in the name of the message (without any other information). In message payload I don’t have that date. Is it possible to use variable from user defined function in message mapping for that name?
    Regards,
    Naycho

    Naycho,
    that's exactly what I've managed to perform using DynamicConfiguration. Check these links:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/43/03612cdecc6e76e10000000a422035/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/43/09b16006526e72e10000000a422035/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/43/03fe1bdc7821ade10000000a1553f6/frameset.htm
    Particularly, I've created a Java API for using setDirectory and setFileName methods through mappings. I use XSLT with java enhancement because it's a million times easier to parse and get node values with XSL than pure java.
    I'm writing a blog on the subject, if you don't resolve the problem until it's out, let me know.
    Regards,
    Henrique.

  • Export copy changed original file name & date

    Photoshop Elements 10.
    I received a digital frame for Christmas.  In order to populate the card, I used the Export as new file, but to copy, not to move.  To fit the files, I had the pictures resized, and to simplify the copies, I had the copies renamed.  the card ended up with what I wanted, but I was left with a big surprise.  The originals had also been renamed.  I can live with that, but I'm not happy.  However, the renaming of the files also touched the file dates, so now I have nearly 5,000 pictures from over 12 years all with toady timestamps.
    I notice that the EXIF dates (picture taken on) are all still there.  Is there a way to set the file dates to the EXIF dates?
    Okay - added notes after my shock.    First of all, files names of the originals were not modified; I just choose a poor folder to look at, and those files names happened to start at xxx0001.  My bad.
    And, while all the pictures I exported/copied were touched and their file dates changed,most of them are still correctly dated in the Elements organizer.  It appears that only those real early files, taken with my first digital camera, which did not have a an EXIF date to begin with, have all been shifted in the organizer to the date/time when the export/copy was made.
    So, while nearly 5,000 files have had their dates changed, in the organizer it is only a couple of hundred that have shifted.
    A) why in the world did these shifts happen?
    B) for those with EXIF dates, any suggestion on correction?

    While a script would probably be best, photoshop 7 requires
    you download a scripting plugin which may or may not install
    in photoshop 7 depending on your version.
    You can probably do what you want with actions. The file naming part
    is not hard, but i have a couple of questions about the cropping.
    Are all the images the same size and are the crops in the same position for each?
    In other words on the P crop (200x250), is the crop in the same position on each
    image or different for each?
    MTSTUNER

  • Importing in to iPhoto using file name date/time

    Hi
    +*I posted this originally in to iPhoto section but they suggest I submit here to see if anyone knows if there's an applescript. Thanks!*+
    I'm not too sure on how to exactly explain my problem but here goes...
    I have a mobile phone that does not save date/time taken data to the picture file when it takes photos. All of my previous phones/cameras have so this has never been a problem before. I Bluetooth photos and then add them to iPhoto '08.
    Problem is when they add they use the date/time added to create the event rather than the date/time taken. The picture filename displays date/time taken and I was wondering if there was a way to use the filename to have iPhoto adjust the metadata tag to the actual date/time taken? This would save me having to adjust time/date for each set of photos. The filename is for example P090308_12.00.jpg if taken on 09/03/08 at 12.00pm.
    I hope this is clear enough and that someone has some advice. Thanks for your help

    01. As per casdvm, download 'ExifTool-7.20.dmg' (872 KB in size), and install 'exiftool''.
    02. Try the provided starter code, editing it according to your needs ...
    --- Code starts here ---
    tell application "iPhoto"
    set tSelection to selection -- Obtain list of selected photos.
    repeat with i in tSelection
    try -- Capture any unexpected AppleScript error(s).
    set imagePath to (image path of i) -- Obtain full path of file.
    set imagePath to quoted form of imagePath -- Encase files' full path in single quote marks.
    set {oAStid, AppleScript's text item delimiters} to {AppleScript's text item delimiters, "/"}
    set imageName to last text item of imagePath as string -- Extract file name from files' full path.
    set AppleScript's text item delimiters to oAStid
    set imageName to get (characters 2 through ((count imageName) - 5) of imageName) as string -- Extract date and time values from file name.
    set tYear to (get (characters 5 through 6 of imageName) as string) -- Extract year from file name.
    if (tYear as number) > ((do shell script "date +%y") as number) then
    set tYear to ("19" & tYear) as string -- Append '19' before 'tYear'.
    else
    set tYear to ("20" & tYear) as string -- Append '20' before 'tYear'.
    end if
    set createDate to tYear & "." & (get (characters 3 through 4 of imageName) as string) & "." & (get (characters 1 through 2 of imageName) as string) & " " & (get (characters 8 through 9 of imageName) as string) & "." & (get (characters 11 through 12 of imageName) as string) & ".00"
    do shell script ("exiftool -DateTimeOriginal='" & createDate & "' -CreateDate='" & createDate & "' -overwriteoriginal_inplace " & imagePath) -- View 'exiftool -h' in 'Terminal'.
    end try
    end repeat
    end tell
    --- Code ends here ---

  • Import File Name Date Incorrect

    I have set import to file name format yyyy mm dd in preferences but Photoshop 11 as in 10 creates the file name in yyyy dd mm format. Is there a fix for this in both PS 10 and PS 11?

    Hi,
    There were some patches for PSE 10
    Mac: http://kb2.adobe.com/cps/930/cpsid_93...
    Win: http://kb2.adobe.com/cps/930/cpsid_93...
    Not sure about PSE 11
    Brian

  • How can I inventory the file name, date, size, type for all my CDs into a readable file on my iMac running Maverick?

    I have many old CDs with files.  In order to organize and search them, I would like to make a searchable file listing all the documents on the CDs.  I once did this in DOS (it was a "list files" command).  Is there anyway to do it in OS X-- Maverick?  I thought Terminal would work, but what I've tried doesn't work.  Any ideas would be appreciated.  I am happy to purchase software that would do the work.

    Oh yeah! Very similar to that one is Print Window. I use it all the time.
    http://www.printwindowapp.com
    It costs $20 if you want all the extra features the free version doesn't have. But I've always used the free version. Nothing in the paid version I need.

  • Apllication file name,time,date and user

    Dear Expert,
    I have a requirement where I would like to see a original application file name,date and time and user who uploaded a file.
    I tried a status log functionality and content version functionality but does not fullfill the req.
    Staus log display only change in status ,user,time and log text.
    Content version gives all what I need but only for those files which gone under any changes and stored in as a new content version but not for a file which don't have any content version
    I need a tables where i will get these information so that with dev some report can be developed.
    Regards
    Abhijit

    Hello,
    If you have document keys, use BAPI_DOCUMENT_GETDETAIL2, pass doc keys and GETDOCFILES = X, use returned table: documentfiles, component - CREATED_AT, CHANGED_AT, CREATED_BY and CHANGED_BY.
    Regards
    Surjit

  • How to rename a flat file concatenating date and time the file name?

    I created a package where I run a first interface that uses a flat file from a server and load into a table in Teradata.
    After using the API OdiFtpPut, I used an FTP file and send to an outfit.
    Since this procedure will operate daily, I need at the time of FTP, get the concatenation destination file name, date and time of execution.
    What is the best practice for this?

    Using OdiFtpPut in the field where it informs the destination file name, instead of putting just the file name (lpn_pln.csv), I put as follows:
    - lp_pln_+<% = odiRef.getSysDate (ddMMyyyyhhmm ")%>+. csv
    For code example, today would record the name lp_pln310120111412.csv
    Anything you can add my msn ---> aluizs @ ig. com. br (no spaces)
    Edited by: andre_l_soares on 31/01/2011 08:16

  • Is there an easy way to run an Ajax function from input type=file to test the file name in DB?

    I've had the <input type="file">  ... <cffile ...> thing going for a few years now. 
    There is a database where the uploaded file names are stored once the files are uploaded to the server.  It sees things in terms of problems and stores uploaded file name accordingly with the ProbID prepended onto the file name; e.g., MyPicture.jpg would end up in the designated directory and databawe as P416_MyPicture.jpg.  This allows user to store pictures with the same name in different problems without a conflict.  There has been an issue with certain characters (e.g., spaces, +, #, etc.) causing problems when they are in file names so we have come up with a way using the <cffile ... rename> to replace these chars with _.  This means that MyPic+.jpg would end up being P416_MyPic_.jpg. 
         This is where the problem appears.  If someone were to upload MyPic+.jpg after someone else uploaded MyPic_.jpg in the same problem, then the + file would overwrite the _ file before the system knew they had a problem.  And there is now way to restore the original file without going to the system backup and doing so – which is a whole other story … especially, if the person doesn’t tell anyone.
         The logical solution would be to be able to test the new final file name (the name after making the substitutions mentioned above) against the existing files in the database before you went from the page where the <input type=file> control to the associated _action.cfm page where the <cffile> object is located.  Given that this seems to be the province of Ajax, this would seem like a natural use of the really interesting technology.  I have can determine the file name from the onChange action on the <input type=File> so that this would be the place for Ajax to come to the rescue by looking up the final file name and then letting the user know whether the resultant name is a unique within the database or not.  If so, I'll just enable the Add button which sets right next to the <input > control and let them upload it.  If not, I'll put up an error message telling them that this file already exists in the system.
         This would be the perfect solution.  It would let me do some Ajax stuff like I've wanted to do for the past year, but never have had the time to do because this is the project that won't go away.  This is, in fact, the last thing of any consequence that remains to do on this 2-1/2 year nightmare – be careful what you wish for.  If I can get this done this week, then maybe I can finally take a weekend off … maybe it will finally come to an end.
         Which finally leads to my question:  I'm looking for some tips on how to get this thing going since I can barely spell Ajax.  I've got a book and looked at some stuff online about CF and Ajax, but a good example or two or three would be worth a day's worth of poking around on the web and in my books.
         Thanks in advance for any suggestions, ideas, help, whatever.
    Len

    Adam,
         Thank you for your suggestion, but, after spending the night working with Ben Forta's CF8, vol 2, Chap 34, working with <cfajaxproxy>, I was able to do exactly what I wanted and it appears, after some testing, to work exactly as I had envisoned it should. 
         I am now calling a JavaScript function (testFileName) from the onChage event on the <input type="file"> or Browse button, which calls my proxy.cfc that contains the server side of the equation.  This funciton testFileName (I've run out of cleaver function/file names).  The query contained therein hits the database to see if the passed in parameters can pull up an existing file.  If they do, the particulars (file name, data attahced, etc.) are returned to the JavaScipt procedure that puts up the error notice.  The user can then chose to either overwrite the file or quit.  Quiting leaves the your on the Attachment PopUp where he/she started with nothing being uploaded. 
         Thanks again for your suggestion.  I appreciate your taking the time to do so.
    Len

  • How can I get Elements 11 Organiser to sort by File Name as in Elements 7

    I have just acquired Elements 11 to replace Elements 7
    All my main photos (thousands) are in 1 file on my computer.
    My individual file names are dates - eg "1960-09Sept Venice St Marks Square.." etc, so File Names bring my thousands of images up in date order.
    I have tagged them in  Elements 11  as  appropriate with 1 or more Tags per photo.
    In Elements 7 there is an Option "Display" and one of the options is "Folder Location" i.e file name order, which is what I want.
    I cannot find this option in Elements 11 - all I have found is an option to sort by just "new" or "old" i.e file date order. Fine for photgraphs where the file date is the same as the photo but a scan done today may be of an image in 1960 which is where I wanted it sorted!
    I know you can amend the file date in Elements 11 for each image but I have hundreds of scans to redate!
    I also know you can bring the images up in Elements 11 of my whole file by using "Reveal in Explorer" which brings them up in file name/date order for me but not when I click on the Elements 11 Tags which reverts to File Date.
    Is there anyway I can get the Tags to sort by File Name/Location in Elements 11 as in Elements 7?
    Tony

    Many thanks for your previous message. Very useful.
    In fact in preparing to answer your question, I find that maybe my problem is not as bad as I thought!
    Yes, I have a lot of photos but the majority in digital form are photos (2,500) since the year 2000 which will be sorted by Elements according to the photo/file date.
    I have 6,000 or so prints/slides going back mostly to the 1930s but quite a few back as far as the late 1800s. I am scanning a lot of these into digital form but I have only scanned about 500 or so so far and it is only these that are causing a problem. (I am unlikely to scan all 6,000!). These range from the 1880s to 2000. However, as I only started taking digital photos in 2000, if I follow your suggestion, I could give all my scans the same file date (a date prior to 2000) and if I understand correctly what you say, they will then all be sorted in the alpha/numeric order I want.
    Have I got this right?.
    I suppose, as an alternative, It would not be a real problem to insert a file date for the 500 or so I have scanned and I would then just need to enter a file date for any future scans.
    As you indicate, there are other options but one of the 2 options above seem at present to be my best bet.
    Thank you very much for your suggestions - maybe I can now more or less get what I want without too much effort but I would still prefer Adobe to add a File Location Option as before!
    First & last paragraphs were edited by: Tony Boulton 8/6/13 0054

  • ORA-15124: ASM file name contain invalid alias name after creating standby

    OS level: redhat 5
    db version: 11gr2
    I just created a standby using rman duplicate from active database and the rman duplicate ran successful.
    Then I modified parameter files on standby to include the current controlfile and try to start the db as mounted, I got following error:
    SQL> startup mount;
    ORA-15124: ASM file name '+DAT/prds/controlfile/current.913.794712357, +FRA/prds/controlfile/current.5616.794712357' contains an invalid alias name
    SQL> exit
    I could not figure out what went wrong here.
    Those are two most current controlfile created during duplicate of db.
    I double checked everythng, everything else seems working.
    What should I look at now?
    Thanks for help as always.

    SQL> startup mount;
    ORA-15124: ASM file name '+DAT/prds/controlfile/current.913.794712357, +FRA/prds/controlfile/current.5616.794712357' contains an invalid alias name
    SQL> exit
    The parameter control_files in pfile/spfile should have value as '+DAT/prds/controlfile/current.913.794712357','+FRA/prds/controlfile/current.5616.794712357'
    It looks like you have missed out the adding quotes to each controlfile path and you have specified both the files under one quote.
    *ORA-15124: ASM file name '+DAT/prds/controlfile/current.913.794712357, +FRA/prds/controlfile/current.5616.794712357'*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Converting file names from Mac to Windows.

    I am an Apple tech at a university that uses both PCs and Macs. We have found that we run into some problems when transferring a user's data from one platform to the other.
    When transferring lots of files, what do you experienced Mac techs use for safely converting file names from Mac to Windows?
    From Windows to Mac?
    We've tried NameCleaner and ended up with bad results.
    Please let me know if there is something good out there for these conversions.
    ---Timothy

    The problem looks like this:
    1. User wants to switch from Mac to Windows.
    2. We back up the data from his Mac to a server (an X-Serve RAID).
    3. We log into the server from Windows.
    4. We try to pull his data from the server.
    During this data transfer, it quits with an error stating that it can't finish copying the data. I wish I had the exact text, but I don't. It does this repeatedly, and stops on different files from different locations.
    In essence, without "cleaning" the Mac file names, data transfer to Windows cannot successfully complete. It quits on certain Mac file names. In the past, NameCleaner has worked sometimes, but now we have had some issues with NameCleaner (which don't matter in this discussion). The goal is to find a better solution than NameCleaner.

  • Pdf portfolio source file name and date in file details

    Is it possible to import the source file name and extension as well as the source file created date in the portfolio file details?  Need to document source to portfolio in working with 3rd parties that will only have the original source.  Need to document what was converted into pdf as not all files in a directory will successfully convert to pdf.  Sometimes need to convert 100's of files.  Manual entry is inefficient.  the file names and modified dates are displayed on the Combine Files dialog.  is there a way to capture the detail on that page?

    I don't need the detail of when the pdf was added to the portfolio.  I
    need know which dwg or jpg or word file was converted and the original
    created date of that file for control of information.
    That is impossible; sorry. For some *very specific* types of conversion to PDF the pdfx:SourceModified XMP tag will be set to show the last-modification date of the source file (for example DOCX files converted using MS Word), but there will never be a human-readable record of the source filename or its creation date unless you have manually added them as document XMP properties after conversion (this is what the "Custom Properties" dialog is for). To embed source data automatically would raise no end of privacy and security problems for customers, who most certainly do NOT want their recipients seeing details of internal documents.
    Without writing a plugin there's no access to the internal workflow of the Combine Files dialog, so you cannot use a script to read the names and dates of the files *before* conversion and store them automatically in the new PDF Portfolio's Fields array.

  • Cannot move any files into trash to delete them. I get a Trash warning box saying "The Finder cannot complete the operation because some data in 'file name' could not be read or written.(Error code - 36)".Macbook has so much data it is almost not working

    Cannot move any files into trash to delete them. I get a Trash warning box saying "The Finder cannot complete the operation because some data in 'file name' could not be read or written.(Error code - 36)".Macbook has so much data it is almost not working.
    I have tried reseting to factory settings by removing battery and holding down the power switch for more than 5 sec but this does nothing.
    Any ideas would be greatly appreciated as I think with so much unwanted data on the desktop and other places the whole os will crash very soon.
    Thanks, Rick

    The hard drive may be dying anyway, or the directory damaged because it is so full.  You should never let the hard drive get over 85% full.
    A -36 error is a read/write error.
    All you did with the power is reset the SMC.  Does nothing to reset everything to factory settings. 
    Do you have your original 10.4 installer discs for the MacBook?
    Is your data backed up?

Maybe you are looking for

  • FCP 7 won't open anymore.

         Two days ago FCP7 wouldn't load from clicking on the most recent project but I was able to start it up from applications and then load the project from there.  Today nothing will load, FCP just hangs up (spinning cirlce) after the effects loadin

  • Sent messages not being received from my iPhone

    Starting about three weeks ago, I began having sporadic issues with text messages (SMS) and iMessages not going through.  I don't appear to have a problem RECEIVING messages, other than they sometimes are delayed by as much as 20 minutes. I have been

  • Using RegEx to achieve the following

    Here is what I want to achieve: INPUT: access-list 99 permit 172.0.0.0 0.255.255.255 access-list 99 permit 192.168.0.0 0.0.255.255 access-list 99 deny any snmp-server community Cust1 RO 99 snmp-server community Cust1-RW RW 99 snmp-server community Cu

  • The error was insufficient data for an image file.

    Dear All, Does anybody know why it is happening while opening a pdf file? insufficient data for an image file. Any Help in this regards, Rgds, Aligahk006

  • 3D objects in After effects

    Hello, I have 3d objects in .3ds, .obj, and .blend. They are the same object. What i am trying to do is import that object into after effects using any of the 3 files. I tried putting it in Photoshop and hen going into after effects but the texture c