Savitzky filter: problem writing to file

Hi,
I have a very weird problem. I m using a Savitzky Golay filter to smooth some data and I can see the correct filtered data on the graph on the front panel. Now, I want to write this filtered data to a file. So I wired the output of the SG filter to a spreadsheet file. On replotting the file, I notice that the graph that I obtain is identical to the input that I gave to the filter. I have attached some screenshots of the front panels and the replotted graph.
Figure one: Is the input to the SG filter
Figure two: Is the output of the SG filter.
Figure three: Is the waveform that I obtained from replotting the output that I wrote to a file.
Figure four: Is the SG filter and write to file VI screenshot.
Can someone please help me out. Its driving me crazy.
Thanks and regards.
Attachments:
sgfilter_writetofile.doc ‏314 KB

You index the output-array of the filter VI before you save it to file. So on the frontpanel you see the whole waveform, but you save only the first value to the file. Another evidendence for this is the messed up x-Axis (time) in the data loaded from your file. The data you see in the file is neither the data before, nor the data after the filter function. You see only the first value of each measurement. YOu have to put a for-loop arround your save to spreadsheet, or better would be to not index the array at all and write the whole array to file. You can use probes to see what I mean.
Hope this helps!
Andre

Similar Messages

  • Problem writing to file

    I'm working on a program that asks for the users name. after that its supposed to pull the current date and time and print that into a file along with the users name.
    my problem is when i open the .txt file i get several characters i dont recogize and then my name at the end.
    Thanks for the help:
    public class CIS314Exam1MarkWellsFrame
    private ObjectOutputStream output;
    public void openFile()
    try
    output = new ObjectOutputStream(new FileOutputStream("guestlog.txt"));
    catch(IOException ioException)
    JOptionPane.showMessageDialog(null, "You do not have access to this file");
    System.exit(1);
    public void insertName()
    try
    Date today = new Date();
    //utput.writeObject(today);
    //String name = JOptionPane.showInputDialog("Enter Name");
    String name = "Mark";
    output.writeObject(name);
    catch(IOException ioException)
    JOptionPane.showMessageDialog(null, "Error writing to file");
    return;
    public void closeFile()
    try
    if(output !=null)
    output.close();
    catch(IOException ioException)
    JOptionPane.showMessageDialog(null, "Error Closing File");
    System.exit(1);
    System.exit(0);
    }

    This isnt the correct forum for this question. Use tags when posting code.  Post the contents of the .txt file and what unexpected characters you are getting.                                                                                                                                                                                                                                                                                                                                           

  • Problem writing external file to externally mounted disk in Windows

    Folks,
    I've got a puzzling problem with a simple OWB mapping where I'm dumping the contents of a table to an external file.
    Versions are OWB v 11.2.0.2 64-bits on Oracle RDBMS 11.2.0.2 Windows 2007 64-bits Enterprise Server.
    When the external files module is hooked up to a location that points to a local disk and directory on the OWB-server, everything works fine - files are created and written.
    When the external files module is hooked up to a location that points to a mounted disk on another Windows 2007 64-bits Enterprise Server, I get +"Invalid Path for target file, check if connector is deployed correctly".+
    The "File System Location Path" in OWB is set to "N:" (no slashes either way). "Test Connection" reports OK.
    I've given both the Oracle os-user and "Everyone" (for good measure) all rights on the mounted disk, and I can see that the generated package code is using the correct Directory, and the Directory Path is the correct one on the server. The mounted disk (N:) should appear as a local disk to Oracle as far as I can see. I'm able to create and delete files on the disk using command line on the OWB/DB-server.
    I'm scratching my head on this one....

    then mapped that share as a network drive (N:) on server A (the OWB/DB-server)I think that problem was with different accounts used for run Oracle database (usually database instance run under SYSTEM account) and which you used to map share (it was interactive session). Even when you made this map persistent (enable "Reconnect at logon" option during mapping) you don't grant access to this drive to other accounts (including SYSTEM ) - this drive will not be visible to other users.
    I think it is possible to create "persistent" network drive mapping for Oracle database context with specification non-SYSTEM account (domain or server local) for running Oracle database instance (and Oracle Listener service).
    Also it seems there is a workaround to access mapped network drive under SYSTEM account:
    http://stackoverflow.com/questions/182750/how-to-map-a-network-drive-to-be-used-by-a-service
    Regards,
    Oleg

  • Problem writing a file!

    I am using NetBeans 5
    I want to save this class...
    package castlesiege;
    import java.util.*;
    import java.io.*;
    public class PlayerVector extends Vector implements Serializable{
      static final long serialVersionUID = -2767605614048989439L;
      public PlayerVector(){
        super(30);
    }using this class... (this is just a test, the real code will be slightly less stupid)
    package castlesiege;
    import java.io.*;
    public class Save{
    public ObjectOutputStream outputMeans;
    public File file = new File("file");
    public Save(){
       PlayerVector veky = new PlayerVector();
       veky.add(new Player());
      try{
       outputMeans = new ObjectOutputStream(new FileOutputStream(file));
       outputMeans.writeObject(veky);
       outputMeans.flush();
       outputMeans.close();
       System.out.println("Complete");
      catch(IOException ioException){
      System.out.print("io");
      ioException.printStackTrace();
    public static void main(String args[]){
      Save x = new Save();
    }I just want to store one vector with lots of different players' data using a very simple technique. And it worked perfectly outside of NetBeans and without the package declaration. But now I get an IOException which is born from a NotSerializableException (I think, I read up the tree). What did I do wrong?

    I figured it out and now I feel like an idiot. I did not know Player also had to be serializable. It was before, but I removed the implementation when I transfered it to NetBeans. I knew I did not need to come to this horrid forum. :-)

  • Problem writing xml file using DOM

    Hi,
    I am trying to write a xml file using DOM. I am using xalan 2.5, xerces 1.4.4, jdk 1.3.1 in JRun 3 on windows.
    The code where I get exception :
                   TransformerFactory tFactory = TransformerFactory.newInstance();
                   Transformer transformer = tFactory.newTransformer();
                   transformer.transform(new DOMSource(doc), new StreamResult("pr.xml"));
    I get the runtime error as follows:
    javax.servlet.ServletException: null
    java.lang.NoSuchMethodError
         at org.apache.xml.utils.DOM2Helper.getNamespaceOfNodeDOM2Helper.java:342)
         at org.apache.xml.utils.TreeWalker.startNode(TreeWalker.java:387)
         at org.apache.xml.utils.TreeWalker.traverse(TreeWalker.java:202)
         at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:343)
    Thinking it is because of classpath, I placed xalan 2.5, xerces 1.4.4 jar files in jrun admin lib directory and in server lib directory as well. Still getting the same error.
    Any suggestion?
    Thanks in advance

    xalan is included in JRun 4. However JRun 3 does not.
    However I tried with the same code in JRun3 in different system. The error is completely different. I understand this is because of different version of files. trying to solve ;)
    Here my new exception
    javax.servlet.ServletException: org/w3c/dom/ranges/DocumentRange
    java.lang.NoClassDefFoundError: org/w3c/dom/ranges/DocumentRange
         at java.lang.ClassLoader.defineClass0(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:493)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
         at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
         at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
         at java.lang.ClassLoader.defineClass0(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:493)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
         at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
         at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
         at org.apache.xerces.jaxp.DocumentBuilderImpl.(Unknown Source)
         at org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(Unknown Source)
         at com.cybell.appl.deliveryorder.cmd.CreateXMLDOFile.createFile(CreateXMLDOFile.java:73)
         at com.cybell.appl.deliveryorder.cmd.CreateXMLDOFile.execute(CreateXMLDOFile.java:36)
         at com.cybell.appl.framework.cmd.BaseCommand.start(BaseCommand.java:50)
         at com.cybell.appl.framework.control.BaseController.service(BaseController.java:38)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
         at allaire.jrun.servlet.JRunSE.service(../servlet/JRunSE.java:1013)
         at allaire.jrun.servlet.JRunSE.runServlet(../servlet/JRunSE.java:925)
         at allaire.jrun.servlet.JRunNamedDispatcher.forward(../servlet/JRunNamedDispatcher.java:34)
         at allaire.jrun.servlet.Invoker.service(../servlet/Invoker.java:84)
         at allaire.jrun.servlet.JRunSE.service(../servlet/JRunSE.java:1013)
         at allaire.jrun.servlet.JRunSE.runServlet(../servlet/JRunSE.java:925)
         at allaire.jrun.servlet.JRunRequestDispatcher.forward(../servlet/JRunRequestDispatcher.java:88)
         at allaire.jrun.servlet.JRunSE.service(../servlet/JRunSE.java:1131)
         at allaire.jrun.servlet.JvmContext.dispatch(../servlet/JvmContext.java:330)
         at allaire.jrun.http.WebEndpoint.run(../http/WebEndpoint.java:107)
         at allaire.jrun.ThreadPool.run(../ThreadPool.java:272)
         at allaire.jrun.WorkerThread.run(../WorkerThread.java:75)

  • "encoding = UTF-8" missing while writing XML file using file Adapter

    Hi,
    We are facing an unique problem writing xml file using file adapter. The file is coming without the encoding part in the header of xml. An excerpt of the file that is getting generated:
    <?xml version="1.0" ?>
    <customerSet>
    <user>
    <externalID>51017</externalID>
    <userInfo>
    <employeeID>51017</employeeID>
    <employeeType>Contractor</employeeType>
    <userName/>
    <firstName>Gail</firstName>
    <lastName>Mikasa</lastName>
    <email>[email protected]</email>
    <costCenter>8506</costCenter>
    <departmentCode/>
    <departmentName>1200 Corp IT Exec 8506</departmentName>
    <businessUnit>1200</businessUnit>
    <jobTitle>HR Analyst 4</jobTitle>
    <managerID>49541</managerID>
    <division>290</division>
    <companyName>HQ-Milpitas, US</companyName>
    <workphone>
    <number/>
    </workphone>
    <mobilePhone>
    <number/>
    </customerSet>
    </user>
    So if you see the header the "encoding=UTF-8" is missing after "version-1.0".
    Do we need to configure any properties in File Adapter?? Or is it the standard way of rendering by the adapter.
    Please advice.
    Thanks in advance!!!

    System.out.println(nodeList.item(0).getFirstChild().getNodeValue());

  • Memory issues writing binary files, using a subVI to do all File Handling, topVI, when run normally files are way too large.

    Problem writing binary files with LV 8.5. I have one VI that does all the interaction/file I/O and another VI for testing. I find when I run the subVI where all the data reading/writing is happening with break points and single stepping through the code all is OK, but when I run normally the files are much larger than they should be and as well when I close the files I get a error. Any insights?  
    Walter

    Waltz wrote:
    I found the problem, I was actually trying to close the files twice.
    I don't see how this could cause the symptoms you described in the first post.
    (It only explains the error on close).
    LabVIEW Champion . Do more with less code and in less time .

  • Upload file - filter problem

    Hi all,
    I have a problem with upload file using JSF RI 1.1 + tomahawk.
    I think that the problem is in the web.inf filter definition because I get these warns:
    17:11:51,875 WARN Digester:127 - [ConverterRule]{faces-config/converter} Merge(null,java.math.BigDecimal)
    17:11:51,890 WARN Digester:127 - [ConverterRule]{faces-config/converter} Merge(null,java.math.BigInteger)
    17:11:52,578 WARN ExtensionsFilter:34 - Please adjust your web.xml to use org.apache.myfaces.webapp.filter.ExtensionsFilter
    And also this error when I click in a button to go to the upload page:
    16:47:47,250 WARN ReducedHTMLParser:468 - Invalid HTML; bare lessthan sign found at line 127
    When I click in the button to go to the upload pages the first time i get this error ad with the second click I get the right page.
    It seems like he go to the filter the first time and then to the faces servlet the second, it is possible?
    this is the code of the web.xml:
    <filter>
            <filter-name>MyFacesExtensionsFilter</filter-name>
            <filter-class>
                org.apache.myfaces.component.html.util.ExtensionsFilter
            </filter-class>
            <init-param>
                <param-name>uploadMaxFileSize</param-name>
                <param-value>10m</param-value>
            </init-param>
            <init-param>
                <param-name>uploadThresholdSize</param-name>
                <param-value>100k</param-value>
            </init-param>
        </filter>
        <filter-mapping>
            <filter-name>MyFacesExtensionsFilter</filter-name>
            <servlet-name>Faces Servlet</servlet-name>
        </filter-mapping>
        And this is the code of the page with upload:
    <h:form id="upload" enctype="multipart/form-data" >
                    <h:outputText value="Gimme an image: "/>
                    <t:inputFileUpload id="fileupload"
                    value="#{fileUploadBean.myFile}"
                    storage="file"
                    required="true"/>
                    <h:commandButton value="load it up" action="#{fileUploadBean.upload}" />
                </h:form>Anyone can help?
    Thanx very much!
    Message was edited by:
    -Frizzi-

    I don't have org.apache.myfaces.webapp.filter.ExtensionsFilter in my libraries, I only have org.apache.myfaces.component.html.util.ExtensionsFilter. I also tried to change it, but it still don't work...
    I tried to redo all the process, and now I can't even access the action method in my backing bean....
    I repost the the file that I use:
    This is the error that I get when I try to use the action method:
    16:24:11,203  WARN ReducedHTMLParser:468 - Invalid HTML; bare lessthan sign found at line 135
    16:24:11,203  WARN ReducedHTMLParser:468 - Invalid HTML; bare lessthan sign found at line 180 web.inf snippet:
    <filter>
            <filter-name>extensionsFilter</filter-name>
            <filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>
            <init-param>
                <param-name>uploadMaxFileSize</param-name>
                <param-value>100m</param-value>
                <description>Set the size limit for uploaded files.
                    Format: 10 - 10 bytes
                            10k - 10 KB
                            10m - 10 MB
                            1g - 1 GB
                </description>
            </init-param>
        </filter>
        <filter-mapping>
            <filter-name>extensionsFilter</filter-name>
            <url-pattern>*.shtml</url-pattern>
        </filter-mapping>
        <filter-mapping>
            <filter-name>extensionsFilter</filter-name>
            <servlet-name>Faces Servlet</servlet-name>
        </filter-mapping>JSF page:
    <h:form id="upload" enctype="multipart/form-data" >
                    <h:outputText value="Gimme an image: "/>
                    <t:inputFileUpload id="fileupload"
                    value="#{fileUploadBean.myFile}"
                    storage="file"
                    required="true"/>
                    <h:commandButton value="load it up" action="#{fileUploadBean.upload}" />
                </h:form>BackingBean:
    public class FileUploadBean {
        private UploadedFile myFile;
        private static Logger log =Logger.getLogger(FileUploadBean.class);
       public String upload() {
            log.info("FileUploadBean.upload");
            try {
            log.info("fileupload_isfile?"+ getMyFile().getBytes());
            log.info("fileupload_path"+ getMyFile().getSize());
            log.info("fileupload_name" + getMyFile().getName());
            System.out.println("myFilename" +getMyFile().getName());
            catch (Exception e){
                log.info("Errore nell'upload");
            return "ok";
        }Please help... I don't know how to solve it. Coul anyone post me a simple WORKING example?
    Thanx a lot!!

  • Director 12- can't create a windows projector - problem writing file error

    I am trying to create a windows projector of a project. when I get the following error - problem writing file - file name- Can't compress file that has been modified and not saved. The file has not been modified and has been saved. Any help would be great.

    Hi.
    You say you have tried publishing to a new empty folder.  From the video I can see that the folder has table1.app in there (25 secs in) which is a Mac projector that has been published.
    Yet you have Windows Projector checkbox ticked at the start of the video.
    I publish Mac and Windows projectors to entirely seperate folders as a matter of practice.
    I call the folders "Published" and "PublishedMac" and that is where the respective projectors for each piece of software lives.
    Perhaps there is some mix up between Mac and Windows publishing that is going on because
    you are publishing both to the same folder?
    Hope this helps.
    Richie

  • Filter to modify html files problem with SC_NOT_MODIFIED

    Hello !
    I am trying to create filter to modify html files before sending to client. I created ResponseWrapper using CharArrayWriter, then I can modify the cached output and later send it to client.
    This code works fine. BUT the browser caches the html files and requests for changed document. Then there is BIG problem, because the chain.doFilter returns response status SC_NOT_MODIFIED and no output is done to client so that there is nothing to modify.
    My question is how to make the chain.doFilter to return requested html document each time and disable SC_NOT_MODIFIED flag.
    Regards,
    Kamil

    Hi,
    Not only "prn" but also for the terms like "AUX", "NUL" you
    can't create any directories or files in Windows because these are
    reserved terms with Windows which is meant for some device
    drivers...

  • Problem writing file to FTP

    whan i am writing the file to FTP in foreground it is working fine.but in backgruond it is failing .what would be the problem...

    i using the below code..
    FORM ftpfinanceaccess_download USING    p_host
                                            p_user
                                            p_password.
      DATA  :
              dest LIKE rfcdes-rfcdest VALUE 'SAPFTP',
              compress TYPE c VALUE 'N',
              host(64) TYPE c.
      DATA: hdl TYPE i.
      DATA: BEGIN OF result OCCURS 0,
            line(100) TYPE c,
            END OF result.
      DATA : key TYPE i VALUE 26101957,
             dstlen TYPE i,
             blob_length TYPE i.
      host = p_host .
      DESCRIBE FIELD p_password LENGTH dstlen IN CHARACTER MODE.
      CALL 'AB_RFC_X_SCRAMBLE_STRING'
        ID 'SOURCE'      FIELD p_password    ID 'KEY'         FIELD key
        ID 'SCR'         FIELD 'X'    ID 'DESTINATION' FIELD p_password
        ID 'DSTLEN'      FIELD dstlen.
      CALL FUNCTION 'FTP_CONNECT'
        EXPORTING
          user            = p_user
          password        = p_password
          host            = host
          rfc_destination = dest
        IMPORTING
          handle          = hdl
        EXCEPTIONS
          not_connected   = 1
          OTHERS          = 2.
      IF sy-subrc = 0.
        CONCATENATE 'cd' ftppath INTO ftppath SEPARATED BY space .
        CALL FUNCTION 'FTP_COMMAND'
          EXPORTING
            handle        = hdl
            command       = ftppath
          TABLES
            data          = result
          EXCEPTIONS
            command_error = 1
            tcpip_error   = 2.
        IF sy-subrc = 0 .
          CLEAR result .
          REFRESH result .
          CALL FUNCTION 'FTP_COMMAND'
            EXPORTING
              handle        = hdl
              command       = 'ascii'
            TABLES
              data          = result
            EXCEPTIONS
              command_error = 1
              tcpip_error   = 2.
          IF sy-subrc = 0 .
            DESCRIBE TABLE iresult LINES lines.
            blob_length =  lines * width .
            clear : lines.
    Delete the existing file
         CONCATENATE 'del' ftpfile INTO delfile SEPARATED BY SPACE.
          CALL FUNCTION 'FTP_COMMAND'
            EXPORTING
              handle        = hdl
              command       = delfile
            TABLES
              data          = result
            EXCEPTIONS
              command_error = 1
              tcpip_error   = 2.
    *End of deleting the existing file
            CALL FUNCTION 'FTP_R3_TO_SERVER'
              EXPORTING
                handle        = hdl
                fname         = ftpfile
                blob_length   = blob_length
                CHARACTER_MODE = 'X'
              TABLES
                TEXT          = iresult
              EXCEPTIONS
                TCPIP_ERROR   = 1
                COMMAND_ERROR = 2
                DATA_ERROR    = 3
                OTHERS        = 4.
            IF sy-subrc <> 0 .
              WRITE 'Error in writing file to ftp' .
            ELSE.
              WRITE 'File downloaded on the ftp server successfully'.
            ENDIF.
          ENDIF.
        ELSE.
          WRITE : 'Path on ftp not found : ' , ftppath .
        ENDIF.
        CALL FUNCTION 'FTP_DISCONNECT'
          EXPORTING
            handle = hdl.
        CALL FUNCTION 'RFC_CONNECTION_CLOSE'
          EXPORTING
            destination = 'SAPFTP'
          EXCEPTIONS
            OTHERS      = 1.
      ELSE.
        WRITE 'Could not connect to ftp' .
      ENDIF.

  • Problems writing a structured binary file...

    Hi Folks,
    I've been working with one of my students to convert this matlab routine into a VI to no avail:
    fwrite(fout,version,'char');
    fwrite(fout,nchar_text,'short');
    % convert wave_text into array of ascii integers
    fwrite(fout,wave_text,'char');
    % output a null character to terminate string
    %count=fwrite(fout,0,'char');
    fwrite(fout,n_bits,'char');
    fwrite(fout,n_bytes,'char');
    fwrite(fout,data_polarity,'char');
    fwrite(fout,user_data,'float');
    fwrite(fout,s_rate,'ulong');
    fwrite(fout,adrange,'float');
    fwrite(fout,n_pts,'long');
    fwrite(fout,wave,'short');
    fclose(fout);
    I've written a VI that can open the files written by this Matlab procedure with no problem (see openfile.VI), however I can't seem to recreate the method for writing this file to binary (writefile.VI).  I think the Matlab approach is very similar to C, and I'm guessing the issue has to do with converting datatypes effectively.  I've been searching the forms and google, but can't seem to come up with the proper solution.  Any pointers would be greatly appreciated!
    Best,
    Jason Gallant
    Attachments:
    writefile.vi ‏27 KB
    openfile.vi ‏26 KB

    crossrulz wrote:
    The additional bytes for the array and string lengths is what is throwing you off.  Even if you turn it off at the Write Binary File, because you built a cluster they will be in there.  You do not want to cluster up your data in this case.  You need to string together a bunch of Write Binary Files, one for each of your parts of data.  Similar to what you had to do in Matlab.
    Great suggestion!  We tried implementing this, and things are looking better.   I've attatched the new VI that implements this.   There still seems to be a problem, however with the datatypes being written.  As mentioned in the previous post, the data written is:
    version   - 'char
    nchar_text, 'short'
    wave_text, 'char'
    n_bits,'char'
    n_bytes,'char'
    data_polarity,'char'
    user_data,'float'
    s_rate,'ulong'
    adrange,'float'
    n_pts,'long'
    wave,'short'
    Should i be typecasting (or something similar) to string in order to make this readable by my previous routine?
    Attachments:
    writefile.vi ‏38 KB

  • Problem installing 7.6.2.9 - Error writing to file

    I've been using iTunes on this particular windows xp pro box since iTunes became available and have never had a problem until I allowed the upgrade.
    I am getting the following error dialog during the "copying files" portion of the install:
    "Error writing to file: C:\Program Files\Common Files\Apple\Mobile Device Support\etc\zoneinfo\Africa\Abidan. Verify that you have access to that directory."
    I have spent quite a bit of time trying to figure this one out. I've scanned for viruses, I've run CHKDSK, I've killed all non essential processes, etc. but continue to get this error message each time I attempt an install.
    I've read through the other posts that were similar but wondered if anyone else has seen this particular problem and been able to overcome the error. I know I could do a clean install, but have so much time invested in this current OS build that I'd rather spend some time trying to solve this. Any help out there would be greatly appreciated.
    Thanks,
    John

    I can't see the file (with hidden files turned on) unless I boot from another partition. Then I can see it, delete it, or whatever I want to do, but once I go back in and do a reinstall, I get the same problem. I've even tried to use Process Manager to try to figure it out, but so far nothing...
    It really felt like a disk problem but chkdsk reports nothing and I've had no other problems except this.

  • Problem with writing to file

    What the program is supposed to do
    Print the squares of one through ten to a file whose name is typed in by the user.
    My Program
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    public class SquareSend
         private JTextField field;
         public static void main(String[] args)
              SquareSend gui = new SquareSend();
              gui.go();
         public void go()
              JFrame frame = new JFrame();
              JTextField field = new JTextField();
              field.addActionListener(new sendToFile());
              frame.getContentPane().add(BorderLayout.CENTER, field);
              frame.setSize(300, 50);
              frame.setVisible(true);
         public class sendToFile implements ActionListener
              public void actionPerformed(ActionEvent e)
                   FileOutputStream out;
                 PrintStream p;
                 try
                         out = new FileOutputStream(field.getText());
                         p = new PrintStream( out );
                         int x = 1;
                          while (x<11)
                               int y = (int)(Math.pow(x,2));
                               p.println("The square of "+x+" is "+y+".");
                               x++;                           
                         p.close();
                 catch (Exception f)
                         System.err.println ("Error writing to file");
    Error Message
    Error writing to file (display message if designated in the try...catch statement).
    Thanks for your help

    use f.printStackTrace() in your catch clause if you want more information about the exception thrown.

  • Problems while writing to file

    Hi,
    I'm trying to query my test database (mysql) and to write these results to a file, I manage to get the results out of the database, but when I try to write for instance an int to a file, the file replaces the int by a square. What can be wrong?? The file is created successfully and I've writen the int to the standard out before writing it to the file; in the standard out the int is correct.
    code:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.sql.*;
    public class getData extends HttpServlet {
    FileWriter fw;
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, java.io.IOException {
    response.setContentType("text/html");
    java.io.PrintWriter out = response.getWriter();
    try {
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    } catch(Exception e){
    System.err.println("Database driverclass not found");
    Connection conn;
         //insert values into DB
    try {
         conn = DriverManager.getConnection("jdbc:mysql://localhost/test?user=admin12&password=adm12");
    Statement stmt = conn.createStatement();
    String slq = "Select * from feedback";
    ResultSet rs = stmt.executeQuery(slq);
    if (rs==null){System.out.println("nOT OK");}
    else{
    try{
    File f = new File("D:\\mysql\\Data.txt");
    fw = new FileWriter(f);
    while(rs.next())
    writeToFile(rs.getString(1));
    writeToFile(rs.getString(2));
    writeToFile(rs.getInt(3));
    writeToFile(rs.getInt(4));
    writeToFile(rs.getString(5));
    writeToFile(rs.getInt(6));
    catch(IOException e)
    System.out.println("Error occured while writing to file");
    stmt.close();
         conn.close();
    } catch(SQLException sqle){
    System.err.println("A SQL error has occured: " + sqle.getMessage());          
    /* output your page here*/
    out.println("<html>");
    out.println("<head>");
    out.println("<title>getDataServlet</title>");
    out.println("</head>");
    out.println("<body>");
    out.println("<h2>Data recovered</h2>");
    out.println("</body>");
    out.println("</html>");
    out.close();
    fw.flush();
    fw.close();
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, java.io.IOException {
    processRequest(request, response);
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, java.io.IOException {
    processRequest(request, response);
    /** Returns a short description of the servlet.
    public String getServletInfo() {
    return "Short description";
    private void writeToFile(int i)
    try{
    System.out.println("test: "+i);
    fw.write(i);
    fw.write(";");
    }catch(IOException e1)
    private void writeToFile(String str)
    try{
    if (str!=null&&(str.equals("null")==false)){
    fw.write(str);
    fw.write(";");
    }catch(IOException e2)

    I would imagine that FileWriter is writing the byte value to the file. Just change your SQL get to this writeToFile(rs.getString(6)); and write it as a String instead of an int.
    DesQuite

Maybe you are looking for

  • How to set up HPLJ4M through AsanteTalk bridge?

    I have a Titanium PB G4 running OS X 10.3.9, a USB inkjet printer that works fine and is the only printer currently in my printer list, and an old LaserJet 4M (Postscript Level II, AppleTalk) that I've never used with the Powerbook. I bought an Asant

  • How do I transfer my Imovie files to my new Mac?

    Last night I received my brand new Imac and transferred the contents from my 2008 Imac using Time Machine BU. Everything seemed in order until I opened Imovie on the new Imac and couldn't see any of my Imovie events. I then hooked the two computers t

  • Plant and company code assignment in Ecc 6.0

    Hi, In 4.7 and ecc5.0 version we can assign only one company code for one plant but we can assign multiple plants to one company code. but in ecc 6.0 we can assign  multiple  company codes to one plant.  what is the main use to maintiang multiple  co

  • How to create Web service proxy in Eclipse?

    Hi, I want to create web service proxy in Eclipse. Can someone tell me what all plug ins are needed for it and what is the detail procedure for the same? Thanks in advance.

  • Extracting bridge metadata

    After adding info to the metadata, such as city, sublocation, state, description, I have to enter all the same data to an MSwroks database that i then import into MSAccess.  I thought maybe there was some way to just transfer data with the same field