How to remove contents of  file

hi frnzs,
i m storing my all output in a file,first time new file is created, and all data is stored, next time when i run again, that file is still there, i just want to remove all contents of it, when again my program runs.

You can also do something like this:
if (file.exists()) {
    file.delete();
}But why do you want to delete the file when you are starting your application? Isn't it better to delete the file when the application exits? You can in that case call deleteOnExit() on the file after you have created it.
Kaj

Similar Messages

  • How to remove a font file and its mapping from XML Publisher Administrator

    Hello,
    I am trying to remove a font file and its mapping from the XML Publisher Administrator. If this is not possible, is there a way to disable it?
    The reason why I am asking this is because we just got a new check printer, and I was able to print just fine. However, the MICR font was not coming up properly on the check, so I went ahead and configured the font with the XML Publisher Administrator. Now my check output is coming up blank after running the XML report publisher program. The only change I did was to upload the MICR font and mapped it.
    My template and rdf report file are working fine in another environment we have, so I know that's not the problem.
    Any help is appreciate it.
    Thanks.

    This is how you do it
    Font
    DELETE FROM xdo_lobs
    where lob_code like '<Font_name>';
    Font Mapping Set
    DELETE FROM xdo_font_mapping_sets_TL
    WHERE mapping_code like '<MAPPING_CODE>'

  • How to remove an XML file from Data Template in Data Definition Screen

    Hi,
    Issue: I have uploaded the file in Data definition in Data Template.
    How to remove it.
    Also what does each file type mean?
    XML Schema
    Data Template
    Preview file
    Bursting control File
    I have an XML file and XSL file. I need to have an output in XML.
    So I installed my XML file in data template in data definition.
    And XSL file in Templates.
    Am I correct?
    11.0.10.2
    Regards,
    Avijit

    Issue: I have uploaded the file in Data definition in Data Template.
    How to remove it.You cannot remove it but you can end-date it.
    Also what does each file type mean?
    XML Schema
    Data Template
    Preview file
    Bursting control FileThis is explained in "Oracle XML Publisher Administration and Developer's Guide Release 12" manual -- http://docs.oracle.com/cd/B34956_01/current/acrobat/120xdoig.pdf
    I have an XML file and XSL file. I need to have an output in XML.
    So I installed my XML file in data template in data definition.
    And XSL file in Templates.
    Am I correct?Correct -- See Chapter 2 "Creating the Template" and Chapter 5 "Data Templates and Chapter" in the same doc referenced above for details.
    Thanks,
    Hussein

  • How to remove  "save pdf file as" dialog in startdoc with adobe acrobat 6

    We set up pdfWriter as default printer and hope to generate pdf file with startdoc call. The existing code worked great on Adobe Acrobat 5. However, after we upgraded to Adobe Acrobat 6(complete install), the same code behaved differently. Somehow, startdoc always popped out a "save pdf file as" dialog box and ask for the file path but ignored the input path parameter(the pdf file was generated at the path that user manully input in).
    W do not like this dialog box at all and expect silent action. How to remove this annoying dialog box and make the old code working (taking the parameter as pdf file path)?
    Thanks for your help.
    JD

    Hi
    I accessed to a website from my uni library computer using my student account and download a pdf file in there. However, that pdf file contains a line of words saying "Accessed by ... University Library on 30 Mar 2007". This line is printed vertically and on the left side of the page.
    Do you know how to remove that line? I think the website just embedded that line into the file.
    Please help.
    Thank you very much.
    tuanduy

  • How to remove all log files at application end ?

    I need to remove all log files from database dir.
    Just the data file must be in database diretory after the application ends.
    I´v tried:
    1 - set_flags(DB_LOG_AUTOREMOVE, 1);
    2 - txn_checkpoint(0, 0, DB_FORCE);
    But ways one log file reminds.
    Any bory nows how remove all log files at application end ?
    I really need this. How can i do that in C++ ?
    Thanks,
    DelNeto

    Here's how I solved it
    // At end of app.
    // Commit tables.
    pdbParam     ->sync(0);
    pdbUser     ->sync(0);
    // Close tables.
    pdbParam     ->close(0);
    pdbUser     ->close(0);
    // Delete table objects.
    delete     m_pdbParam;
    delete     m_pdbUser;
    // Commit all changes to the database.
    penvDbEnv->txn_checkpoint(0, 0, DB_FORCE);
    penvDbEnv->close(0);
    delete penvDbEnv;
    // Remove all logs files comes here.
    DbEnv *penvDbEnv;
    penvDbEnv = new DbEnv(0);
    ui32EnvFlags = DB_CREATE |
    DB_PRIVATE |
    DB_INIT_LOCK |
    DB_INIT_LOG |
    DB_INIT_MPOOL |
    DB_THREAD |
    DB_INIT_TXN;
    // Open the environment with full transactional support.
    iResult = penvDbEnv->open("..\\database", ui32EnvFlags, 0);
    // Get the list of log files.
    char **pLogFilLis;
    char **pLogFilLisBegin;
    iResult = penvDbEnv->log_archive(&pLogFilLis, DB_ARCH_ABS | B_ARCH_LOG);
    // This line resets the log sequence numbers from the database file.
    // No actual log file is associated with the database.
    iResult = penvDbEnv->lsn_reset("..\\database\\DATABASE.db", 0);
    // Remove the log files.
    if(pLogFilLis!= NULL)
    // I don´t now how put spaces and tabs here, sorry about the "___".;-).
    __for(pLogFilLisBegin = pLogFilLis; *pLogFilLis != NULL; ++pLogFilLis)
    ____iResult = remove(*pLogFilLis);
    __free(pLogFilLisBegin);
    // At this point no more log files exists at database directory.
    penvDbEnv->close(0);
    delete penvDbEnv;
    // If i need remove the environment files, do this.
    penvDbEnv = new DbEnv(0);
    penvDbEnv->remove(("..\\database", 0);
    delete m_penvDbEnv;
    Thanks to Bogdan Coman for show me the way
    DelNeto.

  • How to remove Windows XP files/drivers from Petition it was installed on?!?

    So I tried installing Windows XP on my computer, it asked to choose a petition to install it on or whatever, I believe the screen was blue. I chose one and it asked to erase it so I did because I had some issues earlier after trying to quit the installation.
    I had a recovered version of Mac OS X on my external hard drive so it's now my startup disc, is there a way to go back and recover that petition or erase it so I can completely start fresh with Mac OSX.
    When I tried to install the cd's using the holding down "C" when restarting it showed I only had like 14GB of memory total not available but that's all that I had when I know my computer should have 120GB. I am wondering if it was through installing Windows XP so I want to go in and find that petition and remove the Windows and see if that gives me that memory back.
    Anybody know how to either Remove the Windows files(which didn't work anyway) or how to locate the petition and remove the windows files and drivers from it?
    Thanks you!

    Use the Boot Camp Assistant in the /Applications/Utilities/ folder to remove the partition; you may need to use the Disk Utility to repair the drive.
    (32577)

  • How to remove name of file from book?

    Hi there
    I'm about to place an order to buy a book and realized that the name of file appears next to the image.
    can anyone tell how to remove it.
    thank you

    When you are designing a book, on top of the viewer you buttons to edit the layout of the pages.
    The following image will show you the button I'm talking about, it's the grayed one, if you leave the mouse pointer on it for a second you'll see it's called 'edit layout'. Click on it and then you can select and delete all the text boxes you want.

  • How to remove bursting control file?

    Hi,
    I attached a bursting control file to a data definition to test the functionality. Now I want to get rid of it, unfortunately I don't see a delete button or anything similar in XML Publisher Administrator. How can I delete the file?
    Thanks,
    Arthur

    Hi Arthur,
    unfortunately, you can't set any inactive_date or delete the file on the whole. But you can, if you have access to the database the following option, to vanish the file:
    DELETE
    FROM XDO_LOBS
    WHERE LOB_CODE=<DATA_DEFINITION_CODE>
    AND LOB_TYPE='BURSTING_FILE';

  • How to remove DRM from files

    I thought iTunes Match was supposed to remove DRM from files

    royfrommanhattan wrote:
    I thought iTunes Match was supposed to remove DRM from files
    It doesn't actually  "remove" anything.  But it does allow you to delete the DRM versions and download non-DRM versions, if available.
    Go to this document, and read the section on "Can I upgrade my previously purchased music to iTunes Plus?":
    http://support.apple.com/kb/HT1711

  • How to remove content lock in MyEE account?

    thats a shame, but thanks. perhaps, in the future, they'll include an option for PAYG customers - who've provided age evidence - to manage the content lock... A

    Hello, Many pages are locked on EE broadband, so when trying to enter them a message appears that if you're 18+ you can add your CC details or "you can remove Content Lock easily using My EE.*".  When I click on the link, I'm just sent to the login page on EE, it doesn't say where to make the changes. I know that it's possible to use vpn but I rather not, I would just like to change this in my settings because I have a MYEE account and I'm over 18, but it's impossible to find where to change it.  If anyone could help, please let me know. Thank you!  

  • How to remove Recently opened files?

    Is there a way to remove Recently opened files (File>Open Recently Edited File)?

    Reset the preferences. in PSE version 10 and older quit the editor (quit PSE in PSE 8 and lower on a mac) then restart it while holding down ctrl+alt+shift (command+option+shift on a mac). Keep the keys down till you see a window asking if you want to delete the settings file. You do.
    In PSE 11 and 12, go to the editor preferences>general and click this button, then restart the editor:

  • How to remove content from a file?

    i making a student system, whereas students can add their information in text file to the system.
    Format as followed
    firstname
    familyname
    student number
    firstname
    familyname
    student number
    firstname
    familyname
    student number
    how do we remove any certain info

    I think the easiest way is to read the file - manipulate the data in your application - write the data to the file with deleting the old content (append=false)

  • How to remove leftover torrent files...

    I am trying to back up my mac but everytime the back up starts a message comes up saying that 'unable to access vampiros de habana torrent' I will attach a screenshot. I just cannot seem to remove this, I tried using terminal but all that I have left now is a link to a webpage called demonoid, how can I get rid of this glitch and backup my mac?

    I would recommend to post your thread in the archiving forum:
    http://scn.sap.com/community/information-lifecycle-management/content
    This "failure" is either caused by changing the paths in customizing, which means that the programs can no longer find the written archives. Or that someone deleted the archive files physically. Hence they cannot be found anymore and show the flash in front .

  • How to remove partially downloaded files in 10.6

    I could not find any recent helpful answers via Google, but eventually discovered, by trial and error, that you need to delete the failed downloads in three places namely:
    /Library/Updates (this is probably unnecessary)
    and the *two* files here:-
    /private/var/folders/<complicated long path>/<name>
    where <name> ends in .pkg and also in .pkg.resumeData (i.e. the "same name" twice)
    I found out where these were being saved by (*immediately* after the update-failure), typing
    find /private/var/folders -newerct "1 minute ago" -name "*.resumeData"
    and sure enough, these corresponded to the failed downloads. I removed them with
    sudo rm /private/var/folders/<complicated long path discovered via find/<name>.pgk
    sudo rm /private/var/folders/<complicated long path discovered via find/<name>.pgk.resumeData
    and then the software update started working again instead of always aborting with e.g. "iTunes: partially downloaded" etc.
    The reason for the original failure is my poor internet service that constantly breaks halfway through any long-ish downloads.
    An example of the actual filepath on my 10.6.8 Mac OSX is:
    /private/var/folders/02/027LjtRMGXSZNggzpqLQg++++TI/-Caches-/com.apple.SoftwareU pdate/swcdn.apple.com/content/downloads/<same amount again in length>
    in other words, really long winded and very difficult to find (I have been trying to do this all day and could not find anything via the www) - I hope it helps you!

    I deleted the 76% partially downloaded updates from hd>library>updates
    now im at 11% where would I find the rest and how?
    thanks.

  • How to remove thousands of file called with the same name with just one number most of the other

    I've created this thousands of file with a python script, and i've tried to delete all of them using another python script which uses while command and it does work but it's really too slow and my finder crashes. I can't delete all of them manually because it would take forever and from the terminal i don't know how to delete them. The files haven't got an extension and are in my user directory, so please if somebody knows something to do tell me. (sorry for my english)

    Yes there is a way. Post back with the following information:
    1. With respect to your home directory, what is the exact folder that the files are in (ie, are they in the Documents folder, or in a subfolder within the Documents folder). What are the exact names (caps included) of these directories?
    2. What is the exact name scheme of the files? You mentioned they are incremented numerically, but what are the rest of the files' names (again, capitalization is important)?
    With this information, there are several ways to approach the problem, which will basically be four steps to ensure you do not inadvertently remove files you wish to keep:
    1. Create a new folder to temporarily house the files.
    2. Issue a command to target the files by name and move them into a separate folder.
    3. Check the old parent folder to ensure nothing is missing, and optionally check the names of the moved items.
    4. Finally delete the contents of the temporary folder, along with the folder itself.
    The specifics of these steps will depend on the names of the files and the folder that they are in, so provide as much information as you can about that, and we can work through the steps.

Maybe you are looking for

  • Badi for PO ME22n

    hi, I am using the BAdi ME_PROCESS_PO_CUST for PO enhancement.I a want to change the Netprice field into display if the the Gr is being done for that line item while checking in the MKpf Table.But when i use the breakpoint at the FIELDSELECTION_ITEM

  • Comparing columns in table and triggers

    hi masters, i have oracle 10g in Linux and us PL/SQL developer to access database, ia m not a developer, but am assigned task to compare columns in table and associated trigger. let me explain, we have 800 tables, and each table essentially have a tr

  • Sound Input Read Spectrum Analyzer

    I am working on a project with Arduino to do a spectrum analyzer. The LVIFA part of it is working fine. The part that I am struggling with is the audio input. I am using the Sound Input Pallet. My troubles are two-fold. 1. A single read takes quite s

  • Cross tab formatting in Infoview

    I uploaded a Crystal 2008 report into Infoview product version 12.1.0. The report contains indented row labels in the cross tab. When I view the report in Infoview, the indents don't display nicely indented. Instead, they almost look centered, which

  • Key Photo lost when synching with iOS devices

    Hi and thanks for reading. I have noticed that in the last months, when I synch my iPhoto Events with my iPhone one iPad, the Events on iOS devices are not labelled by the same key photos I have on the MAC on iPhoto. Does anybody know the reason? Tha