Preview Destroys Files On Save

Every once in a while, Preview will find a JPG that, after I edit it, it will decide it should destroy on a save--it nulls out the file, keeping a lock on it (I cannot overwrite the file even if I close Preview). It's consistent with the file--if it eats the file once, getting a new copy from backup and editing again will do the exact same thing on a save. Has anyone seen similar behavior?
There is another bug with Preview I'm going to post a different question about involving keywords; it may be related, but I doubt it. Preview has been very, very buggy in Snow Leopard.

http://www.apple.com/feedback/

Similar Messages

  • No File Preview  in "Open" or "Save As" windows in Ps CS6

    This may be a small convenience feature, but I noticed that I can't preview a file in Ps CS6 in the Open window
    Ps CS5 is below:
    I can select a PSD file and preview it whereas I cannot in CS6:
    Same thing with "Save As" and "Place" windows
    Not a big deal, but after all it's the little things that count

    "Forced" to use Bridge?
    I'm not saying you should have to pay for a codec pack (I happen to agree that Adobe should provide a good codec for their formats), BUT...
    Note these screen grabs of Windows Explorer and Photoshop's File-Open dialog... Note especially the raw file thumbnails. Unseen here is that you can view all of these formats seamlessly in the Windows Photo Viewer.
    A good, complete codec pack may just be worth paying for, REGARDLESS of whether you're planning to get Photoshop CS6. 
    -Noel

  • Should I delete preview files to save space on my hard drive?

    Should I delete preview files to save sapce on my hard drive? At times the program crashes and I wonder whether I should get rid of these files to make more space.

    PCNoviceMesa
    Yes.
    If you run a SD project (whether you render stills or videos) and render, you are going to get DV AVI files automatically generated. If it is a HD project, rendering deposits MPEG2.mpg files on your hard drive (whether you render stills or videos). We are talking possibly GB amounts of files if you let them pile up long enough. For Windows 7, 8, or 8.1 64 bit, these preview files are by default in Libraries/Documents/Adobe/Premiere Elements/12.0 and in the Adobe Premiere Elements Preview Files Folder there.
    First let us see how much is piled up there before we take action against them.
    If the preview files there are part of an existing project or projects, the consequence of deleting those files is that you will have to render again that content in the project to get the best possible preview. If the preview files represent project long since gone, good riddance.
    Please check out the situation. And, then we can discuss also pile ups of conformed video and conformed audio files.
    More later.
    ATR

  • I can't  preview svg files in bridge cs6 on mac 10.6.8. Help!

    Hi, I want to know why can't I preview svg files in bridge cs6 on mac 10.6.8. It's really frustrating as an increasing number of Illustrator files are saved in this format and I need to check through a gazillion of them. Help!

    Thanks for the promt reply Omke!
    That was the reason why the thumbnail icons weren't showing up in Bridge. Saving to include XMP data somehow brings in the previews in Bridge.
    I don't really need SVG files for print jobs (prefer .eps or .ai), however this appears to be the preferred file format at the picture library where I bought the vector images.
    Darn, I was hoping that was not the solution, as in order to view the images in Bridge, I will first have to open and  re-save them.
    Seems painful but thanks all the same. Would there be a way in Bridge to batch open and re-save files in another format, say from .svg to .ai ?

  • Editing CSS, related files requires save (cs4)

    You know what really Grinds My Gears? (family guy reference,
    lol)
    When I edit the CSS in the right hand panel, sometimes it
    makes the CSS file in the Related Files toolbar not saved with a *
    next to the filename. Sometimes it goes ahead and just saves the
    changes right away. Like most, I'm constantly switching back/forth
    between browsers so CSS has to be saved to see changes.
    Kindofa pain to have to click the css file in the related
    toolbar and Ctrl+S to save before each preview...I haven't been
    able to find out why it "dirties" the CSS file sometimes and other
    times it directly saves to the CSS file.
    Does anyone have any ideas? How to get it to always just save
    to the file?
    thanks

    avibodha,
    Ah! Thanks for the additional details. I see what is causing
    this behavior.
    When a document is opened, DW determines what the Related
    Files are, so
    it can show the list of buttons for each one. But, for the
    sake of
    performance, we do not actually load the files until you
    click on a
    button to view a file. Note that the file may already be
    loaded as a
    top-level document or as a Related File of some other
    document.
    Since you have the "Open CSS files when modified" setting
    turned off,
    then the CSS gets automatically saved to disk *if* the file
    has not yet
    been loaded. Once the file has been loaded, then DW will not
    automatically save it (to avoid writing something on disk
    that you don't
    want written).
    So, you'll need to disable the Related Files feature to have
    DW always
    automatically save the CSS to disk.
    HTH,
    Randy
    > * related files always on, open document
    > * edit CSS in right panel (separate css file, not inline
    styles), always saves
    > immediately
    > * Either click .css file and edit, or in right panel,
    click Go To Code and
    > edit CSS -> now all edits in right panel will happen
    to file and NOT be saved.
    > You must go to the .css file and Save it.
    >
    > So once you edit the CSS file for for any reason, from
    then on it edits the
    > css file when you use the right panel and you must go
    back to the file and
    > save, or do Save All.
    >
    > There is a setting in Preferences, CSS Styles to
    automatically open the CSS
    > file when editing, but I have that off (default state).
    >
    > Curious...wonder if there's a way to "reset" the right
    panel CSS back to it's
    > original state of directly modifying the css file? If I
    close and re-open the
    > document, that does it, but that's not a solution...
    >
    > Not a big deal because I can turn off Related Files...

  • Finder cannot preview prores files.

    I just purchased a new iMac with Lion 10.7.2.
    In Snow Leopard (on an older machine) I was able to preview prores files directly in finder by pressing spacebar. With Lion, finder just keeps searching for a solution and never finds one. I can see the files if I open them in Quicktime, but having at least a thumbnail would save a lot of time.

    The problem isn't the file's icon, which is clearly visible (in this case a Quicktime movie icon), it's the ability to view it by pressing the spacebar while in the Finder (what is commonly referred to as "Quick Look" - same as in Mail).
    This problem only occurs with ProRes files; all other Quicktime formats Quick Look in the Finder just fine.  ProRes used to as well in Snow Leopard and all previous versions of OS X, it's only since upgrading to Lion that this no longer works.
    It's worth adding that the ProRes Quicktime component is still in the Quicktime folder in the Library, and ProRes files still open in Quicktime 7, Quicktime X, Final Cut Pro Studio 3, and iTunes.
    Any thoughts?
    Thanks,
    Max

  • How export to csv work in safari browser? In my application export to csv open like a raw data in new tab. But other browsers working great!. Need to open in a csv file or save it as a csv file.

    How export to csv work in safari browser?
    In my application export to csv open like a raw data in new tab.
    But other browsers working great!.
    Need to open in a csv file or save it as a csv file.
    Please suggest me. Thank you in advance!.

    Hi Adrian,
    Why don't you try any another software for opening CSV files then Notepad ? According to my experience, you can use these softwares to open an CSV files and they are:-
    Microsoft Excel
    Open Office Calc
    Google Docs
    Also there is an additional tool available known as CSV viewer. You may try this, download it from here http://www.csvviewer.com/
    I've never used Notepad for opening CSV files, because sometimes it contains some symbols which are not not at all compatibile with Notepad.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • Why is it that when I try to open a project, it says "the project contained a sequence that could not be opened. No sequence preview preset file or codec could be associated with this sequence type"?

    It could be opened last night but today it just kept showing "the project contained a sequence that could not be opened. No sequence preview preset file or codec could be associated with this sequence type". I really need to access my video.
    Some help out there, please?

    Hi,
    Please check this out : https://forums.adobe.com/message/4626663#4626663#4626663
    Thank You
    Arjun

  • Problem with preview PDF files on Windows 7 32bit

    Hello,
    in my office I have a problem with preview PDF files on my computers. The files are allright, but if I select a file and click on preview mode after ~ 10sec operation system write something "Preview this file is corrupt for PDF Preview Handler wrong". On other 64bit computers with same programs the preview is work. I try uninstall all Adobe soft (Reader, Flash), clean all Adobe data from folders in root and in register, but it is not solve this problem. On Microsoft forums wrote me, that the problem is probably with AR plugin.
    So, can someone help me?
    Config PC:
    Windows 7 32/64bit Pro
    Intel i3, 4GB
    Adobe Reader 11.0.5
    Adobe Flash Player 15 ActiveX
    Adobe Flash Player 15 plugin
    Preview Handler Surrogate Host ver.: 6.1.7601.17514
    Thank you for help.

    I think I figured it out after reading other forums. Thanks!

  • Is there a way to preview any file as HTML? I need to preview .INC files as HTML, but can't make FireFox to display them as anything other than plain text.

    As a part of design I have .INC files that contain HTML that is to be processed by PHP. The extension is .INC to separate it from .HTML files which don't need pre-processing.
    I sometimes need to preview those files as HTML, but Firefox always displays them as plain text. Is there a way to tell Firefox that .INC files should be displayed as .HTML?

    One at a time is the answer to both questions, I'm afraid.  There is no automated way to do either.

  • Preview transformation file in data manager package

    Dear BPC Experts,
    When we try to preview Tranformation file while running data manager package to import transaction data from BW, we are getting following error. We do not get this error if we use load from flat file package.
    We are on BPC 10 PS06, EPM Add-in SP14 patch3.
    Has anybody seen this issue before? We can paste the entire log if required.
    See the end of this message for details on invoking
    just-in-time (JIT) debugging instead of this dialog box.
    ************** Exception Text **************
    System.ArgumentException: Separator cannot be null and must contain only one char
    Parameter name: separator
       at FPMXLClient.DataManager.CsvParser.Parse(String data, String separator, Boolean hasHeader) in d:\Olympus_100_REL_XLCLIENT\src\FPMXLClient\src\DataManager\CsvParser.cs:line 15
       at FPMXLClient.DataManager.UI.Forms.FilePreview.BuildDataArrayFromCsv(String data) in d:\Olympus_100_REL_XLCLIENT\src\FPMXLClient\src\UILayer\DataManagerUI\Forms\FilePreview.cs:line 487
       at FPMXLClient.DataManager.UI.Forms.FilePreview.BuildDataArray(String data, Boolean formatted) in d:\Olympus_100_REL_XLCLIENT\src\FPMXLClient\src\UILayer\DataManagerUI\Forms\FilePreview.cs:line 414
       at FPMXLClient.DataManager.UI.Forms.FilePreview.SpecialFilesProcessing() in d:\Olympus_100_REL_XLCLIENT\src\FPMXLClient\src\UILayer\DataManagerUI\Forms\FilePreview.cs:line 406
       at FPMXLClient.DataManager.UI.Forms.FilePreview.DisplayData() in d:\Olympus_100_REL_XLCLIENT\src\FPMXLClient\src\UILayer\DataManagerUI\Forms\FilePreview.cs:line 351
       at FPMXLClient.DataManager.UI.Forms.FilePreview.InitializePreview() in d:\Olympus_100_REL_XLCLIENT\src\FPMXLClient\src\UILayer\DataManagerUI\Forms\FilePreview.cs:line 102
       at FPMXLClient.DataManager.UI.Forms.FilePreview.FilePreview_Load(Object sender, EventArgs e) in d:\Olympus_100_REL_XLCLIENT\src\FPMXLClient\src\UILayer\DataManagerUI\Forms\FilePreview.cs:line 740
       at System.Windows.Forms.Form.OnLoad(EventArgs e)
       at FPMXLClient.UILayer.Forms.BaseForm.OnLoad(EventArgs e) in d:\Olympus_100_REL_XLCLIENT\src\FPMXLClient\src\UILayer\UI\Forms\Base\BaseForm.cs:line 70
       at System.Windows.Forms.Form.OnCreateControl()
       at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
       at System.Windows.Forms.Control.CreateControl()
       at System.Windows.Forms.Control.WmShowWindow(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       at System.Windows.Forms.Form.WmShowWindow(Message& m)
       at System.Windows.Forms.Form.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    Best Regards,
    Ashwin.

    Hi Raju,
    Thank you for your reply.
    It seems that it is SP related issue. When we downgrade our EPM Add-in to SP13 patch4, it did not throw any error.
    Best Regards,
    Ashwin.

  • List of downloads is blank after I changed the file to save to. How can I restore the list of downloads?

    I have already tried the all the steps in this link.
    '''http://support.mozilla.com/en-US/kb/Downloads%20window%20is%20blank?s=+downloads+list&as=s'''
    I have changed the file to save to back to the original one as well.

    Try opening the problem files using a text editor or file viewer to see what the first few bytes contain. All valid FM binary files for FM 11 will contain <MakerFile 11.0> in the first bytes of the file.
    When updating books, it's sometimes better to just to create a new book file and add the files to that.
    When renaming files in a book, changes at the system level will break any links/cross-references between files, so it's always best to use the Rename option in the Book file to change FM file names. This will maintain the correct linkages.

  • Will office web apps preview msg files in Sharepoint 2013

    We are filing Outlook msg files into sharepoint and want to be able to preview the files without opening them one by one.
    Will office web apps do the work?
    Thanks

    No, OWA does not support msg file types.
    SharePoint - Nauplius Applications
    Microsoft SharePoint Server MVP
    MCITP: SharePoint Administrator 2010
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • I have moved old Back Up files from my external hard drive to the trash and as the Trash previews the files, i.e. counts them (over 850,000 files) it then begins to delete but then stops. Is it possible to move the files out of the Trash file and then onl

    I have moved old Back Up files from my external hard drive to the trash and as the Trash previews the files, i.e. counts them (over 850,000 files) it then begins to delete but then stops. Is it possible to move the files out of the Trash file and then only delete a small amount at one time?

    See
    Deleting backups via the Finder on Lion 10.7.x or later:
    http://pondini.org/TM/12.html
    Hold option (alt) while emptying the Trash.
    See also
    http://pondini.org/TM/E6.html
    Message was edited by: WZZZ

  • Read multiple files and save all into one output file(AGAIN)

    Hi, guys
    I need your help for reading data from multiple files and save the results into one output file. When files are selected from file chooser, my program read the data line by line , do some calculations and save the result into the output. I made an array to store input files and it seems to be working fine, but when it comes to SaveFile() function, issues NullPointException message.
    public class FileReduction1 extends JFrame implements ActionListener
       // GUI definition and layout
        /* ACTION PERFORMED */
        public void actionPerformed(ActionEvent event) {
            if (event.getActionCommand().equals("Open File")) getFileName();
        /* OPEN THE FILE */
        private void getFileName() {
            // Display file dialog so user can select file to open
         JFileChooser fileChooser = new JFileChooser();
         fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
            fileChooser.setMultiSelectionEnabled(true);
         int result = fileChooser.showOpenDialog(this);
         // If cancel button selected return
         if (result == JFileChooser.CANCEL_OPTION) return;
            if (result == JFileChooser.APPROVE_OPTION)
             files = fileChooser.getSelectedFiles();
                textArea.setText("");
                if(files.length>0)
                    filelist="";
                    System.out.println("files length"+files.length);
                    for(int i=0;i<files.length;i++)
                         System.out.println(files.getName());
    filelist+=files[i].getName()+" ,";
    if (checkFileName(files[i]) )
    openButton.setEnabled(true);
    readButton.setEnabled(true);
    textArea.append("file "+files[i].getName()+"is a proper file"+"\n");
    readFile(files[i]);
    textfield.setText(filelist);
    else{JOptionPane.showMessageDialog(this,"Please select file(s)",
                    "Error 5: ",JOptionPane.ERROR_MESSAGE); }
         // Obtain selected file
    /* READ FILE */
    private void readFile(File fileName_in) {
    // Disable read button
    readButton.setEnabled(false);
    // Dimension data structure
         getNumberOfLines(fileName_in);
         data = new String[numLines][4];
         // Read file
         readTheFile(fileName_in);
         // Rnable open button
         openButton.setEnabled(true);
    /* GET NUMBER OF LINES */
    /* Get number of lines in file and prepare data structure. */
    private void getNumberOfLines(File fileName_in) {
    int counter = 0;
         // Open the file
         openFile(fileName_in);
         // Loop through file incrementing counter
         try {
         String line = fileInput.readLine();
         while (line != null) {
         counter++;
              System.out.println("(" + counter + ") " + line);
    line = fileInput.readLine();
         numLines = counter;
    closeFile(fileName_in);
         catch(IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error reading File",
                   "Error 5: ",JOptionPane.ERROR_MESSAGE);
         closeFile(fileName_in);
         System.exit(1);
    /* READ FILE */
    private void readTheFile(File fileName_in)
    // Open the file
    //int row=0;
    int col=0;
    openFile(fileName_in);
    System.out.println("Read the file");
    // Loop through file incrementing counter
    try
    String line = fileInput.readLine();
    while (line != null)
    boolean containsDoubles = false;
    double temp;
    String[] lineParts = line.split("\t");
    try
    for (col=0;col<lineParts.length;col++)
    temp=Double.parseDouble(lineParts[col]);
    data[row][col] = lineParts[col];
    containsDoubles = true;
    System.out.print("data["+row+"]["+col+"]="+lineParts[col]+" ");
    } catch (Exception e) {row=0; col=0; temp=0.0;}
    if (containsDoubles){ row++;}
    System.out.println();
    line = fileInput.readLine();
    catch(IOException ioException)
    JOptionPane.showMessageDialog(this,"Error reading File", "Error 5: ",JOptionPane.ERROR_MESSAGE);
    closeFile(fileName_in);
    System.exit(1);
    //System.out.println("length"+data.length);
    closeFile(fileName_in);
    process(fileName_in);
    /* CHECK FILE NAME */
    /* Return flase if selected file is a directory, access is denied or is
    not a file name. */
    private boolean checkFileName(File fileName_in) {
         if (fileName_in.exists()) {
         if (fileName_in.canRead()) {
              if (fileName_in.isFile()) return(true);
              else JOptionPane.showMessageDialog(null,
                        "ERROR 3: File is a directory");
         else JOptionPane.showMessageDialog(null,
                        "ERROR 2: Access denied");
         else JOptionPane.showMessageDialog(null,
                        "ERROR 1: No such file!");
         // Return
         return(false);
    /* OPEN FILE */
    private void openFile(File fileName_in) {
         try {
         // Open file
         FileReader file = new FileReader(fileName_in);
         fileInput = new BufferedReader(file);
         catch(IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error Opening File",
                   "Error 4: ",JOptionPane.ERROR_MESSAGE);
         textArea.append("OPEN FILE\n---------\n");
         textArea.append(fileName_in.getPath());
         textArea.append("\n");
         //System.out.println("File opened successfully");
    /* CLOSE FILE */
    private void closeFile(File fileName_in) {
    if (fileInput != null) {
         try {
              fileInput.close();
         catch (IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error Opening File",
                   "Error 4: ",JOptionPane.ERROR_MESSAGE);
    System.out.println("File closed");
    private void process(File fileName_in) {
    //getNumberOfLines();
         //data = new String[numLines][3];
         // Read file
    double temp,temp1;
         //readTheFile();
    //System.out.println("row:"+row);
    //int number=data.length;
    //System.out.println(number);
    for (int i=0; i<row; i++)
    temp=Double.parseDouble(data[i][1]);
    sumx+=temp;
    temp1=Double.parseDouble(data[i][3]);
    sumy+=temp1;
    multixy+=(temp*temp1);
    square_x_sum+=(temp*temp);
    square_y_sum+=(temp1*temp1);
    //System.out.println("Sum(x)="+sumx);
    double tempup=(row*multixy)-(sumx*sumy);
    double tempdown=(row*square_x_sum)-(sumx*sumx);
    slope=tempup/tempdown;
    double tempbup=sumy-(slope*sumx);
    intb=tempbup/row;
    double tempside=(row*square_y_sum)-(sumy*sumy);
    double cordown=Math.sqrt(tempdown*tempside);
    corr=tempup/cordown;
    r_sqrt=corr*corr;
         textArea.append("Data for file"+ fileName_in.getName()+" have been processed successfully.");
         textArea.append("\n");
         textArea.append("Please enter output file name including extension.");
    System.out.println("number"+row);
    System.out.println("slope(m)="+slope);
    System.out.println("intecept b="+intb);
    System.out.println("correlation="+corr);
    System.out.println("correlation="+r_sqrt);
    saveFile();
    private void saveFile()
    textArea.append("SAVE FILE\n---------\n");
    if (openFile1())
         try {
              outputToFile();
    catch (IOException ioException) {
              JOptionPane.showMessageDialog(this,"Error Writing to File",
                   "Error",JOptionPane.ERROR_MESSAGE);
    private boolean openFile1 ()
         // search for the file path
    StringBuffer stringpath;
    title=textfield1.getText().trim();
    int temp=fileName_in.getName().length();
    int temp_path=fileName_in.getPath().length();
    int startd=(temp_path-temp);
    stringpath=new StringBuffer(fileName_in.getPath());
    stringpath.delete(startd, temp_path+1);
    //System.out.println("file-path="+temp_path);
    //System.out.println("length-file="+temp);
    path=stringpath.toString();
    fileName_out = new File(path, title);
    //System.out.println(file_out.getName());
    if (fileName_out==null || fileName_out.getName().equals(""))
         JOptionPane.showMessageDialog(this,"Invalid File name",
                   "Invalid File name",JOptionPane.ERROR_MESSAGE);
         return(false);
         else
    try
    boolean created = fileName_out.createNewFile();
    if(created)
    fileOutput = new PrintWriter(new FileWriter(fileName_out));
    fileOutput.println("File Name"+"\t"+"Slope(m)"+"\t"+"y-intercept(b)"+"\t"+"Coefficient(r)"+"\t"+"Correlation(R-Squared)");
    return(true);
    else
    fileOutput = new PrintWriter(new FileWriter(fileName_out,true));
    return(true);
    catch (IOException exc)
    JOptionPane.showMessageDialog(this,"Please enter the file name","Error",JOptionPane.ERROR_MESSAGE);
    return(false);
    private void outputToFile() throws IOException
    // Initial output
         textArea.append("File name = " + fileName_out + "\n");
         // Test if data exists
         if (data != null)
         fileOutput.println(fileName_in.getName() +"\t"+ slope+"\t"+intb+"\t"+corr+"\t"+r_sqrt);
    textArea.append("File output complete\n\n");
         else
    textArea.append("No data\n\n");
         // End by closing file
    initialcomp();
         fileOutput.close();
    private void initialcomp()
    slope=0.0;
    intb=0.0;
    corr=0.0;
    r_sqrt=0.0;
    sumx=0.0; sumy=0.0; multixy=0.0; square_x_sum=0.0; square_y_sum=0.0;
    for(int i=0;i<data.length;i++)
    for(int j=0;j<data[i].length;j++)
    data[i][j]=null;
    /* MAIN METHOD */
    public static void main(String[] args) throws IOException
         // Create instance of class FileChooser
         FileReduction1 newFile = new FileReduction1("File Reduction Program");
         // Make window vissible
         newFile.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         newFile.setSize(500,400);
    newFile.setVisible(true);
    Sorry about the long lines.
    As you can see, all input files saved in array called files, however when OpenFile1() function is called, it take input (fileName_in) as a single file not an array. I'm assuming this causes the exception.
    When there's muptiple inputs, program should take each file from getFileName() to outputToFile() sequentially.
    Does anybody have an idea to solve this?
    Thanks a lot!!

    you naming convention is confussing. you should follows Java naming convention..you have a getXXX but decalred the return type as "void"...get usully means to return something...
    your code is doing too much..and hard to follows..
    1. get the selected files
    for each selected file
    process the file and return the result
    write out the result.
    /** close the precious resource */
    public void closeResource(Reader in){
        if (in != null){
            try{ in.close(); }
            catch (Exception e){}
    /** get the total number of line in a file */
    public int getLineCount(File file) throws IOException{
        BufferedReader in = null;
        int lineCount = 0;
        try{
            in = new BufferedReader(new FileReader(file));
            while ((in.readLine() != null)
                lineCount++;
            return lineCount;
        finally{ closeResource (in);  }
    /** read the file */
    public void processFile(File inFile, File outFile) throws IOException{
        BufferedReader in = null;
        StringBuffer result = new StringBuffer();
        try{
            in = new BufferedReader(new FileReader(inFile));
            String line = null;
            while ((in.readLine() != null){
                .. do something with the line
                result.append(....);
            writeToFile(outFile, result.toString());
        finally{ closeResource (in);  }
    public void writeToFile(File outFile, String result) throws IOException{
        PrintWriter out = null;
        try{
            out = new PrintWriter(new FileWriter(outFile, true));  // true for appending to the end of the file
            out.println(result);
        finally{  if (out != null){ try{ out.close(); } catch (Exception e){} }  }
    }

Maybe you are looking for

  • Nearly there but not quite - Please help with display issue

    Hi, I had an issue with my mac starting which I resolved by replacing the graphics card. The mac now starts without issue BUT! In display preferences there is only one display resolution, no detect display button and if I try to calibrate the sliders

  • Why can't I get my Mac to like the LDAP server?

    On Monday I started hammering away at getting the LDAP server setup on the Linux server with openldap. I was able to get a test Mac running Leopard to see the LDAP server and the accounts. The next battle was to get home directories to mount under /h

  • How to create a new database object?

    i login at sys or system, then enter below: create database project; the error is < privileges deny > what is going wrong??? null

  • Macbook is not turning on

    Hi guys, For some reason my MacBook Pro (2009) is not turning on anymore. Yesterday evening it still worked perfectly though. I read a few times that I only have to remove the battery and out it in again but this didn't help so far. Any other ideas?

  • Spinning ball mode

    i do not know the correct term for this mode but it is when the round multi colored ball spins and everything else ceases to work. my macbook is doing this far too much and it is hard to get anything to run. i have a gig of ram and i am not asking it