Save file as date

import java.io.*;
import java.text.*;
import java.util.*;
public class Test {
public static void main(String[] args) throws IOException{
SimpleDateFormat sdf = new SimpleDateFormat("ddMMyyHHmmss");
BufferedWriter writer =new BufferedWriter( new FileWriter("C:\\"+sdf.format(new Date())+".txt"));
writer.write("wett");
writer.close();
  }The above code saves a file like this format
040403105659
How can I make that a bit more readable
eg 4/4/4 10:56:59

SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yy HH:mm:ss");that may do it, although it's never a good idea to have '/' characters in a file name (it may not even let you), and for that matter it's not good to have blanks either.
Mike

Similar Messages

  • How to auto save output with date added to file name, and email the results?

    Hi,
    We found a script to capture disk space usage, that automatically places the results into an Excel file. We would like the script to autosave this file to a specific directroy with the date ran as part of teh file name. We would then like these results to
    be emailed to us if possible. (also if possible to highlight cell in red that is 5% OR less available disk space would be great)
    Here is what we have:
    $erroractionpreference = “SilentlyContinue”
    $a = New-Object -comobject Excel.Application
    $a.visible = $True
    $b = $a.Workbooks.Add()
    $c = $b.Worksheets.Item(1)
    $c.Cells.Item(1,1) = “Machine Name”
    $c.Cells.Item(1,2) = “Drive”
    $c.Cells.Item(1,3) = “Total size (GB)”
    $c.Cells.Item(1,4) = “Free Space (GB)”
    $c.Cells.Item(1,5) = “Free Space (%)”
    $c.cells.item(1,6) = "Name "
    $d = $c.UsedRange
    $d.Interior.ColorIndex = 19
    $d.Font.ColorIndex = 11
    $d.Font.Bold = $True
    $d.EntireColumn.AutoFit()
    $intRow = 2
    $colComputers = get-content "C:\Servers.txt"
    foreach ($strComputer in $colComputers)
    $colDisks = get-wmiobject Win32_LogicalDisk -computername $strComputer -Filter “DriveType = 3"
    foreach ($objdisk in $colDisks)
    $c.Cells.Item($intRow, 1) = $strComputer.ToUpper()
    $c.Cells.Item($intRow, 2) = $objDisk.DeviceID
    $c.Cells.Item($intRow, 3) = “{0:N0}” -f ($objDisk.Size/1GB)
    $c.Cells.Item($intRow, 4) = “{0:N0}” -f ($objDisk.FreeSpace/1GB)
    $c.Cells.Item($intRow, 5) = “{0:P0}” -f ([double]$objDisk.FreeSpace/[double]$objDisk.Size)
    $c.cells.item($introw, 6) = $objdisk.volumename
    $intRow = $intRow + 1
    $d.EntireColumn.AutoFit()
    cls
    Thank You

    Hi Phorbin1128,
    The script below amy be helpful for you to save the Excel file with date in filename, and send email with the attachment of the excel report.
    $erroractionpreference = “SilentlyContinue”
    $a = New-Object -comobject Excel.Application
    $a.visible = $True
    $b = $a.Workbooks.Add()
    $c = $b.Worksheets.Item(1)
    $c.Cells.Item(1,1) = “Machine Name”
    $c.Cells.Item(1,2) = “Drive”
    $c.Cells.Item(1,3) = “Total size (GB)”
    $c.Cells.Item(1,4) = “Free Space (GB)”
    $c.Cells.Item(1,5) = “Free Space (%)”
    $c.cells.item(1,6) = "Name "
    $d = $c.UsedRange
    $d.Interior.ColorIndex = 19
    $d.Font.ColorIndex = 11
    $d.Font.Bold = $True
    $d.EntireColumn.AutoFit()
    $intRow = 2
    $colComputers = get-content "C:\Servers.txt"
    foreach ($strComputer in $colComputers)
    $colDisks = get-wmiobject Win32_LogicalDisk -computername $strComputer -Filter “DriveType = 3"
    foreach ($objdisk in $colDisks)
    $c.Cells.Item($intRow, 1) = $strComputer.ToUpper()
    $c.Cells.Item($intRow, 2) = $objDisk.DeviceID
    $c.Cells.Item($intRow, 3) = “{0:N0}” -f ($objDisk.Size/1GB)
    $c.Cells.Item($intRow, 4) = “{0:N0}” -f ($objDisk.FreeSpace/1GB)
    $c.Cells.Item($intRow, 5) = “{0:P0}” -f ([double]$objDisk.FreeSpace/[double]$objDisk.Size)
    $c.cells.item($introw, 6) = $objdisk.volumename
    $intRow = $intRow + 1
    $d.EntireColumn.AutoFit()
    $date=Get-Date -f yyyy-MM-dd
    $filename = "D:\test\"+$date+".xlsx"
    $b.SaveAs($filename)
    $a.Quit()
    Send-MailMessage -SmtpServer xxxxxxxxxx -To [email protected] -From [email protected] -Subject "test mail" -Body "file name is: $new_file" -attachment $filename
    For more detailed information about the cmdlet Send-MailMessage, please refer to this article:
    Send-MailMessage
    I hope this helps.

  • Adobe Reader XI did not save the form data (unlike previous versions). Any way to recover file?

    Adobe Reader XI did not save the form data (unlike previous versions). Any way to recover filled form with data from temp locations?
    I was not aware that ctrl+s no longer works in reader and closed the PDF after savign it(with ctrl+s). However ,the data is lost and there seems to be no way to recover it.
    I cannot find any temp files created by Reader on my system.
    Also to my surprize(and shock), the reader did not even show a warning before closing the PDF. Does anybody know if/where can I recover the file from?
    Guys, Please reply ASAP if you have got any sort of solution!

    Hi Pat,
    Are you using Adobe Reader XI? And not Acrobat. It does not ask me to save the form if there are unsaved changes.
    I have used previous versions of reader for saving this form data and it did allow me to save it with ctrl+s. And those versions did prompt me to save the changes before closing.
    I guess I should not have updated the reader.

  • How do I save a mutlitcolumn data to a text file?

    I am trying to save a multicolumn data to a text file without using Report Generation VIs. Here is the detail scenario...
    I have data in the following format.
    Time Voltage
    1 2
    2 3
    3 6 ...
    and
    Power
    1
    and
    Peaks
    x-axis y-axis
    Peak1 1 4
    Peak2 5 11
    If I have such data, how would I put them in a columnar format with their title and labels in a text file.
    Any example VIs would be nice to see.
    Thanks.

    Here is one solution, hope it helps. I would like to see this done using clusters and less shift arrays, I'm sure there are a few ways to do this with less wires but i guess that's what sub vi's are for...
    Attachments:
    data_to_col..vi ‏98 KB

  • How does my application save the raw data to binary file?

    Hi all,
    At first, please look at my attachment. There is the part of my code (it is inside of a while loop) which saves a raw data from my firewire camera. I am thinking how does this saving process work? How does it save the data in each while loop's iteration time (pixels, rows and columns)? For example if I use 100x1000 8-bit image. There is also Set File Position.vi which makes next line after iteration (at least I think so?). It is important to know when I'm processing the data later with Matlab.
    My second question:
    If I set height = 100 and width = 1000 as parameters, image indicator from IMAQdx Grab's image out says that the image is "only" 1000x96 8-bit image. Where are "missing" 4 bits?
    B R,
    Jick
    Attachments:
    binarysave.JPG ‏40 KB

    Hi again,
    Here is my whole CameraSoftware. It is a part of the bigger measurement program.
    I hope you can find the solution of "lost 4 bits"
    B R,
    Jick
    Attachments:
    camerasoft.JPG ‏162 KB
    save&grab.JPG ‏48 KB
    confcam.JPG ‏38 KB

  • Admin Services - Data Prep Editor: Save, Open, Open Data File - Hangs

    The problem is that whever I try to Open, Open Data File or Save while in Data Prep Editor, the Admin Console Hangs. It shows as Responding in the task manager, but the screen turns grey (hangs) and the admincon.exe process is constant at about 50% CPU.
    I don't know what is going on? Is there possibly some corrupt disk area on my PC? I checked everyone on forums, tried to find the answer, but no info is availabe? I re-installed to JRE 1.5, I checked the java environmental variables. I did so much, but nothing has worked.
    At first I thought it might have been some 9.3.1 bug, so I unistalled 9.3.1 and installed EPM System 11; still same problem!!
    Any help is greatly appreciated. Thanks

    I have a similar problem, when I try to open a data file, nothing happens.... app doesn't lock, just the file open dialog box never opens... I'm using 9.3.1, and the same problems happens, on EAS installed locally, Web client, and running EAS from the app server itself. The load rule works fine, I just can't see a data file in the prep editor. Any thoughts help are appreciated.
    Chad

  • EVDRE: refresh dimension cache files each time user saves or refreshes data

    Hi experts,
    We're facing a performance trouble with our input schedules, so we pretend to decrease response times.
    We've noticed an unexpected issue when users work with input schedules. Each time they save or refresh data into any input schedule, it seems to execute a dimension files refresh. Since they push Save buton till standard success message appears, we see diferent text messages in excel messages bar, in the bottom of excel window. And for a while, we can see a message where we can read "Load dimension cache".
    Does anyone know if this is an standar behaviour? Is there any way to avoid that, so we can decrease response time regarding input schedule performance?? Is there any dimension files refresh while we save data from an input schedule?
    Thanks in advance.

    I see these, too, running Fx12 on Windows 7. They are described in the (extremely voluminous!) about:cache interface as page thumbnails. I've attached some screen shots.
    The text is extremely difficult to see, so I don't know whether it is a serious privacy/security risk. I would be curious to know how long they linger.
    I think these support the Windows feature of showing a preview of a window or tab when you float over a taskbar button. (No idea whether there is a similar preview feature on Mac.) This feature is not enabled by default; users need to enable it in about:config. However, add-ons may be able to use the thumbnails because they have privileged access to the cache.
    (Note: This feature was added pursuant to [https://bugzilla.mozilla.org/show_bug.cgi?id=497543 497543 – Provide a thumbnail service]. It "landed" on or about Jan. 28, 2012, so its first appearance in a released version of Firefox might have been Fx12.)

  • How to save internal table data to file on local disk from smartforms?

    Hi there,
    I'm trying to save internal table data into .csv file on presentation server from within smartforms using GUI_DOWNLOAD function.
    This function works fine from abap program, but when I call it from smartforms it does nothing. Form prints ok and there is no file created on local dick.
    Is there a way to save smartforms internal table data to local disk?
    Thanks in advance,
    Baske

    Hi Jey,
    Thanks for your prompt replay.
    Unfortunately, Iu2019ve tried both your suggestions without success. Smartforms behaves just like in case of GUI_DOWNLOAD. There is no file saved on disk.
    Do you have any other idea?
    BR,
    Baske

  • Re Time Machine "You do not have appropriate access privileges to save file ".002332b7be8a" warning preventing backups--this may help temporarily

    My TM is often giving me the "You do not have appropriate access privileges to save file “.002332b7be8a” in folder “Time Machine Backups”" message when I go to select my backup drive. I've reviewed past archived discussions on this and, like many other people, gotten completely flummoxed trying to find a permanent solution.  Tried the suggested fixes via Terminal and it didn't help because I couldn't get through the entire process without Terminal telling me it couldn't find a file or drive.  When I can find the time, I'm going to try Tinker Tool to reveal where that numbered file actually is and give it another go.
    In the meantime, for those who are desperate to get their TM working again to get at least one backup done, I can offer people a temporary solution that's worked for me.
    I've found that restarting my iMac somehow resets TM and usually allows it to do at least one of its automatic backups, sometimes several, before it reverts back to failing and producing that same darn warning message.  I only want a backup done once a day, so it's not that inconvenient to go this route.
    There's another even quicker  method (perhaps a little more risky but hasn't been a problem for me yet) that I've been using more recently, and that is to simply unplug the external while the iMac is on (I close system preferences first though, and make sure TM isn't actually doing anything at the time) then plugging it back in and choosing the backup drive again in the TM system preferences window once that drive has shown up again in the Mac's list of devices.  I don't get that warning message when I do this.  It works every time for me and so far it hasn't lost or corrupted any data on the external, despite the warning message you get on Macs when you unplug a USB device without ejecting it first.  However, do this at your own risk--don't flame me if it backfires on you.  If you're of the opinion that it's not wise to unplug the device this way, then fine, go ahead and state such in this thread, but be polite about it.
    Hope this helps anyone who's frantic to make a backup without having to start from square one with a whole new complete initial backup (can take many hours to make one) on a fresh external drive.
    By the way, I've read somewhere that this problem was fixed with Snow Leopard.  Whether that's true is another matter.  I'm not quite ready to update to 10.6 for other reasons, even though I bought it, and I figure some other people are also still using 10.5.8 out of fear and loathing around the unknowns of installing a new OS too, so that's why I thought I'd post this message (couldn't find a discussion around this that was still active and not archived).

    noodlenose wrote:
    My TM is often giving me the "You do not have appropriate access privileges to save file “.002332b7be8a” in folder “Time Machine Backups”" message when I go to select my backup drive.
    Wow, I haven't seen that in a looooong time!
    Tried the suggested fixes via Terminal and it didn't help because I couldn't get through the entire process without Terminal telling me it couldn't find a file or drive.
    Do you mean in #C5 of Time Machine - Troubleshooting?
    When I can find the time, I'm going to try Tinker Tool to reveal where that numbered file actually is and give it another go.
    It should be at the top level of the drive.
    By the way, I've read somewhere that this problem was fixed with Snow Leopard.
    Yes.  I'm not sure if it was 10.6.0 or one of the early updates, but I haven't seen any reports of this in quite a while.

  • Microsoft Office 2004 (Word) unable to save files  I have been running Office 2004 on my Intel iMac with Snow Leopard for some time and all of a sudden I cannot save a document. Word just stopped responding and I have to force quit. I can open Word and cr

    Microsoft Office 2004 (Word) unable to save files
    I have been running Office 2004 on my Intel iMac with Snow Leopard for some time and all of a sudden I cannot save a document. Word just stopped responding and I have to force quit. I can open Word and create a new document but I cannot save it. I reinstalled Word but that didn’t help. Then went to the Internet and found at least one other Mac user having the same problem which it suggests is caused by a recent Mac Security Update:
    http://answers.microsoft.com/en-us/mac/forum/macoffice2004-macword/word-2004-wil l-not-open-or-save-documents/b04eb870-9b0d-4f3b-bb47-b122301e36f6
    So I check for a new Mac Security Update and sure enough there was one. I downloaded it and now Word seems to be working, as it should. I can both open and save files. The only problem remaining is that when I open Word I get the following error message “An unexpected error occurred while trying to load the Microsoft Framework library”. I contacted Apple but they were unable to help.
    How can I get rid of this error message?

    Look, I realize you might have to get your machine working, so this is how you revert back.
    Restore proceedure to pre-Security Update 2012-001 v 1.0 & v 1.1
    #1 Backup your personal data off the machine.
    Backup files off the computer (not to TimeMachine). If you don't have a external drive, get one and connect to the USB/Firewire port and simply drag and drop copy your User folder to the external drive, it will copy all your files. It's best to have two backups of your data off the machine when trying to restore.
    Disconnect all drives now to prevent any mistakes from occuring.
    #2 Reinstall OS X 10.6 from disk
    Get out your 10.6 install disk and make sure it's clean and polished (very soft cloth and a bit of rubbing alcohol, no scratches) If your disk is borked, you'll have to order a new one from Apple with your serial number.
    Hold c boot off the 10.6 disk (wired keyboard, internal optical drive), use Disk Utility First Aid to >Repair Disk  of your internal drive  (do not format or erase!!), Quit DU and simply re-install 10.6.
    Note: Simply reinstalling 10.6 version from disk (without erasing the drive) only replaces 10.6.8 with 10.6.x and bundled Apple programs, won't touch your files (backup anyway)  or most programs, unless they installed a kext file into OS X itself. (only a few on average do this)
    #3 Update to 10.6.8 without Security Update 2012-001 v1.0 or v1.1
    Reboot and log in, update to 10.6.8 via Software Update, but EXCLUDE THE Security Update 2012-001 by checkinig the details and unchecking the blue check box.
    #4 Reinstall any non-working third party programs
    When you reboot, make sure to reinstall any programs that require kext files installed into OS X, you'll know, they won't work when you launch them or hang for some reason as they are missing the part they installed into OS X.
    If for some freakish reason you get gray screen at any time when booting (possible it might occur when you reinstall older programs), hold the shift key down while booting (Safe Mode, disables kext files) and update your installed third party software so it's compatible with 10.6.8.
    https://support.apple.com/kb/TS2570
    That's it really.

  • How do I add a "file folder" to my TC so that I can save files directly to the TC?

    I am trying to figure out how I can add a "File Folder" to my TC so that I can save files directly to it? The only folder it displays is "Data" which is where my bac ups save...

    Double click on the "Data" folder in the Finder under the SHARED heading, and then click the gear icon at the top of the window and select New Folder.
    You can name this folder anything you wish and also create as many folders as you wish.
    If you are also using the Time Capsule drive for Time Machine backups, it is not really recommended that you "mix" regular files with Time Machine backups because there will be a struggle for space on the drive at some point.
    If you have plenty of free space on the Time Capsule drive, you may be OK with keeping a portion dedicated for regular files.

  • Is there a way to organize files by date added?

    I'm trying to put a scrapbook together for a friend and am including all of the files he sent me and stuff in order of the date that he sent them...but there's only the option to organize by date modified or date created....none of which help me with this...I really need to do date added. Is there any way to do it?

    I apologize if I misunderstood your question. So are you asking when someone sends you pics in a email, you want to add them to iphoto or a folder in finder by the date of the email and not the date of picture? I am not sure if this will help or maybe you already did this. I chose "quick look" at the attachment of an email with an older pic and chose the icon to add to iphoto. When I did this it created a event with todays date. The email was from Jan 4th, so it recognized todays date. Unfortunately though, when I tried this with recent pics sent to me (xmas), it created a folder based on the date the picture was taken. So I am really not sure if there is a way to do it. The only other suggestion I have, which is not the quickest. First I would create a specific folder for this project in finder. Next when you receive the email, click to save attachment. In the "save as" box, name the file the date you received it and any additional info if you want. Next find the folder you created and save in there. At least you will be able to access the pics in one place and the file name will say when you received them. I hope this helps. I am not an expert yet on my mac, but I just tried that and it worked. Good luck. Lee Ann

  • How can you determine a file creation date and know if it's been altered since the creation date

    I need to know how to determine a file creation date on an ipad.  If someone creates a document/note on an ipad how can you tell when it was created and if it has been altered since?

    Unless you are using a third party app that provides that functionality, in iOS the only thing youcan access is the last edit/save date and time, which is fairly evident in the user interface for documents and notes. Some apps that handle MS Office files may provide that, but ican't say first hand.

  • I want to use Get Panel Image in Labview 5.0.1 and need details on how to save the BMP data generated

    I am trying to generate an application that saves a copy of its front panel on completion. This is easy to do using an invoke node with Print VI to HTML but this does not work in an .exe format. I have seen elsewhere that you have to use the Get Panel Image method, but no details are supplied in LV 5.0.1 documentation of how to use the "image" data (1-D Unsigned Byte array) that is generated. I want to save this in a format that can then be read as a bitmap in any standard graphics package. Any assistance?

    Hi,
    If you'd upgrade to LV5.1 or 6 you could use the 'standard' vi's for this.
    You need a VI called "Write BMP File.vi". It's not shipped with LV5.0.1.
    This vi only uses 3 subVI's, so perhaps someone at NI can convert it and
    send it to you (sorry, I won't, it's copywrited).
    If you cannot get this VI anywhere, you'll need to figure out the BMP file
    format yourself. It's not too complicated, but still could take some days.
    Perhaps someone figured it out before LV5.1 was released.
    Regards,
    Wiebe.
    "RDK" wrote in message
    news:[email protected]..
    > I want to use Get Panel Image in Labview 5.0.1 and need details on how
    > to save the BMP data generated
    >
    > I am trying to generate an application that saves a copy
    of its front
    > panel on completion. This is easy to do using an invoke node with
    > Print VI to HTML but this does not work in an .exe format. I have seen
    > elsewhere that you have to use the Get Panel Image method, but no
    > details are supplied in LV 5.0.1 documentation of how to use the
    > "image" data (1-D Unsigned Byte array) that is generated. I want to
    > save this in a format that can then be read as a bitmap in any
    > standard graphics package. Any assistance?

  • How do I save files to external hard drive in anticipation of a OS clean install?

    How do I save files to an external hard drive in anticipation of a OS clean install?  I'm worried that the new OS will not be able to find my photos.
    My data have not been backed up for 2 months, and the OS is corrupted.  Currently working with a senior Apple engineer on this.  It looks like a clean install will be necessary.
    This question will also extend iTunes :/

    How to correctly move your media:
    iTunes: How to move the library to an EHD
    iPhoto: How to move the Library to an EHD
    It is important that the External Hard Drive is formatted as Mac OS Extended (journaled).

Maybe you are looking for

  • Lumia 520 SMS- when a contact has more than one nu...

    Hi- when calling a contact who has more than one phone number it is easy to choose which of the numbers for that contact to use, but when sending SMS there is no option to choose. How does the SMS system decide which of the available numbers to use?

  • Want to install SSD and make it the main drive

    Hello, I just purchased my Lenovo IdeaCenter H530 Desktop and straight away installed a GT640 video card.   Everything seems good and I'm waiting to install a SSD.   I would like to run windows 8.1 from the SSD as the primary drive, and use the 1TB H

  • How do you  tell what generation iPod you have?

    Just curious as how to tell what generation iPod a friend has?

  • Retina macbook pro slow boot up and shutdown?

    I have a Macbook Pro with retina display (2.6/16/512) and it's just 2 weeks old. When i first got it bootup and shutdown times were pretty awesome (Below 15 seconds for cold bootup and 5 seconds for shutdown). Now after installing many applications (

  • Calling Portlets in Portal Pages

    Guys, Can anyone guide me , how can I call a portlet by clicking a link in another portlet? Please note that I dont want to call a JSP page , but a portlet. Thanks in advance, -Sarma.