Trouble writing to file with FileWriter

Hey I'm pretty new to Java and even newer to file classes so I'd appreciate it you could look over what I've done. My FlashCard object has its own toString() method which prints out what I want it to so basically all I need to know is why it doesn't print anything?
File f;
//..Constructors and other methods for a JFrame
     private void printList() throws IOException
               writer = new PrintWriter(new BufferedWriter(new FileWriter(f)), true); //f is a File object declared below
               writer.println("test");
               java.util.Iterator<FlashCard> e = cards.iterator();
               String s = "";
               while(e.hasNext())
                    s = "" + e.next();
                    writer.println(s);          
                    System.out.println(s);   //Debugging line, prints out what i want to be put in the file correctly!
               writer.close();
               FileWriter writer2 = new FileWriter(f, true);
               writer2.write("hi");
//....more code
private class ClickListener                          //subclass of the class containing the code above
               implements ActionListener
               @Override
               public void actionPerformed(ActionEvent e)
                    if (e.getSource() == create)
                         boolean temp = false;
                         String fileName = "c:\\FlashCards\\";
                         f = new File(fileName);
                         f.mkdir();
                         f = new File(fileName + stackName.getText() + ".txt");
                         try {
                              temp = f.createNewFile();
                         } catch (IOException e1) {
                         //...More code here for responding to file not being created successfully
                         f.setWritable(true);
                         control.currentFile = f;
                    }This the the only code I thought to be relevant but if there's a declaration you need that I left out let me know! The annoying thing is I copied this from another class I wrote (with modifications of course) and it works perfectly, no problems!
Thanks in advance!

OK I've done the things you've mentioned, thank you for me notice i was missing some code organization. The problem unfortunately is not yet solved but now I think I have a better idea of what the problem is! Here's the code:
This is what I'm using to make a file
private void createFile()
               boolean temp = false;
               String fileName = "c:\\FlashCards\\";
               f = new File(fileName);
               f.mkdir();
               f = new File(fileName + stackName.getText() + ".txt");
               try {
                    temp = f.createNewFile();
               } catch (IOException e1) {
                    //TODO fill in exception catchs
               if(temp)
                    //Do something
               else
                    JOptionPane.showMessageDialog(addCard, "File Name Already Exists");
                    return;
          }And this is where the file is being used by a writer:
          private void printList() throws IOException
               String temp = f.getAbsolutePath();
               PrintWriter writer = new PrintWriter(new BufferedWriter(new FileWriter(new File(temp), true)), true);
               java.util.Iterator<FlashCard> i = cards.iterator();
               while(i.hasNext())
                    writer.println(i.next());          //TODO fix this writer so that it prints properly onto the document!!
               writer.close();
          }The problem I think is either caused by a) the new File doesn't like properly to the FileWriter for some reason or b) the file I've made does not work for output for some reason. I think this because I can make a new file with a literal pathname such as "c:\\file.txt" and it works fine but as soon as I use my file f to make it it doesn't print anything out!! any ideas?

Similar Messages

  • Suppress writing cache files with rwrun.exe

    Hello,
    we`re using rwrun.exe (9.0.4.2.0) with parameters to create pdf-files in a loop:
    REPORT=mytest.rdf
    USERID=scott/tiger@orcl
    BLANKPAGES=no
    DESTYPE=file
    DESNAME=mytest.pdf
    DESFORMAT=PDF
    OUTPUTIMAGEFORMAT=GIF
    CACHELOB=NO
    Each process write a cache file in the directory …\reports\cache. Reports eats the hard disk :-(
    I`ve found the EXPIRATION command in the documentation, which defines the point in time when the report output should be deleted from the cache. But this command strictly runs with rwclient.exe and reports server, but Reports server isn`t installed on our server.
    Can we suppress writing cache files with rwrun.exe?
    Steffen

    Hello,
    Why don't you add a command del in your loop ?
    Example:
    del %ORACLE_HOME%\reports\cache\*.*
    Regards

  • Trouble opening acrobate files with reader 10.1.7.

    I have trouble opening acrobate files with reader 10.1.7. When I click  on the file to open it with adobe reader x, nothing happens. If I click  on Adobe Reader X icon, a message comes up: preparing to install. After  that, I can open a PDF, but only until the next reboot.

    Something went amiss during the install. Windows keeps trying to finish the incomplete install every time Reader opens.
    Use the Adobe Cleaner to completely remove Reader.
    Download the offline installer and reinstall without a download manager

  • Trouble Writing Large Files to Time Capsule - Windows 7

    Hi
    I'm having some trouble with my Time Capsule. I can access it and read files from it fine. However, I have trouble writing files to it. Small files ( say multiple word docs) write fine. However, with medium size files (say 120 mb) it crashes. I have noticed that no matter how large the file is, it writes up to 10% of the file very quickly but then crashes. It fails with the error message that 'the network location specified is no longer available'. Sometimes, when it crashes, it essentially crashes my Time Capsule network. I.E I am still connected to the internet but I can access the Time Capsule.
    I used to be able to write files (when I was using Vista) no problem. I still have 250gb left.
    What can I do to fix this?
    For details:
    500gb Time Capsule
    Windows 7 64bit Home Premium

    anyone know how to help?

  • Writing Datalog Files with record length

    How do I write a Datalog File with a record length of 128 int16s?

    Each I16 number in LabVIEW that you write uses 2 bytes because 8 bits equals 1 byte. If you write 128 numbers, the file will be 256 bytes long. You can modify the VI to write I32 (4 bytes) or I8 (1 byte) just by changing the representation of the number. You also need to change the subVI that does the actual writing (Write File+ [I16].vi). Be sure to rename the VIs that you change. I would think that your Fortran program would work as long as the data types match.

  • Writing to file with ObjectOutputStream

    ApartmentWriterProgram asks information about apartments
    and saves it to a file.
    For some reason it doesnt save information, it writes:
    Writing to file "+file+ " failed.
    So there happens IOException in the method write(Apartment apartment).
    Or in the run().
    I dont know what's wrong. Do you?
    public class ApartmentFileHandler extends Object implements Serializable {
        private OutputStream outStream;
        private ObjectOutputStream obStream;
        private String filePath;
            public ApartmentFileHandler(String filePath) {
               this.filePath = filePath;
    /** Writes the given apartment data in the file. If the file already
    exists, the old contents are overwritten.
    Parameters:
    apartment - the apartment to be written in the file
    Throws:
    IOException - if other problems arose when handling the file (e.g. the
    file could not be written)
            public void write(Apartment apartment)
               throws IOException {
               outStream = new FileOutputStream(filePath);
               obStream = new ObjectOutputStream(outStream);
               obStream.writeObject(apartment);
    import java.io.*;
    import java.util.*;
    public class ApartmentWriterProgram
    extends Object
        private KeyboardReader keyboardReader;
        private List roomsInList;
        private Room[] rooms;
        private int numberOfRooms;
        private String file;
              public ApartmentWriterProgram()
                this.keyboardReader = new KeyboardReader();
                this.roomsInList = new ArrayList();
                this.rooms = new Room [numberOfRooms];
    /** Runs the writer program. The program asks the user for some
    apartment data and a file name, and saves the data in the file. */
              public void run() {
                try {
                  numberOfRooms = keyboardReader.getInt("Give number of rooms: ");
                  for (int i =1; i<numberOfRooms+1; i++) {
                     String type =keyboardReader.getString("Give " +i+ ". " + "type of the room: ");
                     double area =keyboardReader.getDouble("Give " +i+ ". " + "area of room: ");
                     Room room= new Room(type, area);
                     this.roomsInList.add(huone);
                  roomsInList.toArray(rooms);
                  Apartment apartment = new Apartment(rooms);
                  System.out.println();
                  file = keyboardReader.getString("Give name of the file: ");
                  ApartmentFileHandler handler = new ApartmentFileHandler(file);
                  handler.write(apartment);
               } catch (IOException ioe) {
                 System.out.println("Writing to file "+file+ " failed.");
             public static void main(String[]  args) {
                  ApartmentWriterProgram program = new ApartmentWriterProgram();
                  program.run();
    }

    There is nothing to gain in not putting the throws IOException in the write method, since the exception object will have the information about the actual problem.
    Is this a typo for the this post?                 this.roomsInList.add(huone); should be room nes pas.
    What exception is actually thrown? To find out useSystem.out.println("Exception: " + ioe);Then wonder why you have the AppartmentFileHandler implement Serializable when you are not writing that object to the file.

  • Trouble converting powerpoint files with png images to pdf-Can someone help?

    Hello all,
    In my line of work, I create and modify large sized posters that are created in powerpoint. I would have the files print ready by converting them to pdf. I usually have little to no issues executing this. However, I have been dealing with an issue of converting ppt files with png images. The size of the ppt is typically a 42x56 file. The several ways to convert to pdf produces an error each time. Png images are very useful as they provide much clarity vs jpegs or tiffs. The 3 ways I have tried below are:
    A) File>Print>Adobe PDF>High Quality print settings/300dpi results to an error message that says:
         "Windows cannot print due to a problem with the current print setup. Try one of the following:
         *Check the printer by printing a test page from Windows.
         *Make sure the printer is turned on and online.
         *Reinstall the printer driver"
         A blank pdf opens up (Selected to open file after publishing)
    B) File>Save as> Change file type as a pdf results in nothing happening. No pdf is produced.
    C) Acrobat>Create PDF results to an error message that says: "An unexpected error occured. PDFMaker was unable to produce the Adobe PDF."
    Again, this all happens with ppt files with png images. I took out the png images and attempted to convert to pdf, and the pdf is produced! 
    Can anyone provide any assistance in creating pdfs with png images or what settings I need to adjust? I am able to covert every other image type (jpeg, tiff, bmp), except for png images.
    I am using Microsoft Office 2010 with Adobe Acrobat X on Windows 7 (This happened on Windows XP as well).

    >I have a 48 slide presentation that has a small .png image in the "slide
    >master" so it will show up on every page.
    PowerPoint only has to store one instance of the image even thought it is
    displayed on multiple slides. But Acrobat can't do the same, the image has
    to be stored for every page that it appears on, so that would explain the
    larger file size.
    Acrobat is supposed to be able to optimize the storage of common background
    images (at least that's the message I see when I do a "Save as..."), but I
    have yet to see it to work. Maybe it depends on the application the orginal
    file is created in and the PDF conversion method used.
    Adding the image into a PDF file later as a watermark instead may be a way
    to keep the size down (then it really only does store the object once),
    though I believe that watermark images will appear in front of everything
    else on the page (not sure if that's a problem for you, it depends on
    whether any text or objects in the presentation ever appear in front of the
    image).
    What are the dimensions and resolution of the image in PowerPoint? You may
    be able to go as low as 75 dpi and not notice a difference, it depends on
    whether the image contains any areas of high contrast or text.

  • (SOLVED) Trouble merging .pacnew files with meld

    Dear Archers
    Unable to merge .pacnew files, following the example on ArchWiki. Only, the difference between the two files shown
    [root@KRISHNA san2ban]# #!/bin/bash
    [root@KRISHNA san2ban]# # pacnew-update - merge *.pacnew files with original configurations with meld
    [root@KRISHNA san2ban]#
    [root@KRISHNA san2ban]# pacnew=$(find /etc -type f -name "*.pacnew")
    [root@KRISHNA san2ban]#
    [root@KRISHNA san2ban]# for config in $pacnew; do
    > # Merge with meld
    > gksu meld ${config%\.*} $config &
    > wait
    > done
    [1] 1578
    GConf Error: Failed to contact configuration server; the most common cause is a missing or misconfigured D-Bus session bus daemon. See http://projects.gnome.org/gconf/ for information. (Details - 1: Failed to get connection to session: The connection is closed)
    GConf Error: Failed to contact configuration server; the most common cause is a missing or misconfigured D-Bus session bus daemon. See http://projects.gnome.org/gconf/ for information. (Details - 1: Failed to get connection to session: The connection is closed)
    Also, on the Archwiki, we are advised to change 'kdesu' to 'gksudo' for GNOME, but I think it should be gksu
    Last edited by San2ban (2011-08-18 14:07:53)

    San2ban wrote:
    Dear Karol
    Thanks. yes, manual intervention is needed
    Wonder how it will be without you guy's guiding us
    You bet your ass, manual intervention is needed. If you try to blindly just merge *.pacnew with original files, it might lead to an unbootable system. Especially when you get pacnew files for /etc/group and /etc/inittab

  • Writing a file with the OutputStream

    I'm trying to upload a file using Java's included ftp functionality.
    currently I'm trying to figure out how to upload a file. The connection and works.
    The code I found for the ftp connection indicated that I should use the following code to upload..
    URLConnection urlc = url.openConnection();
    OutputStream os = urlc.getOutputStream();
    I've read the documentation for the outputstream and looked for help tutorials on the web etc, but still haven't been able to figure out what I'm doing.
    I need the output stream to write a file to the ftp server. I can get it to put a file there, but so far its just been an empty file. How do I get it to actually write the file with its contents etc.
    thanks for the help

    never mind :) I think I figured it out.
    I just created a File object for the file, then opened a fileinputstream to read the file in and wrote that output using the output stream.
    it seems to work.

  • Writing to file with specific encoding in unix

    hi,
    I want to write html files which contain Turkish characters in unix operating system.
    I'm currently using FileWriter to write the files.
    I'm getting the file content from the database and I can see that the characters seem to be fine but when I write them into an html file, they are displayed with the question mark character (?).
    What can I do about this?
    Thanks

    FileWriter uses the default character encoding of whatever platform your program is running on. Beside the fact that the default encoding may vary from one machine to another, it may not be suitable for storing non-ASCII (Turkish) characters.
    Rather than using FileWriter, you can use an OutputStreamWriter and a FileOutputStream, which allows you to specify the character encoding you want. UTF-8 is generally a good choice, since it can encode just about anything. For example:FileOutputStream fos = new FileOutputStream("/some/file/name");
    OutputStreamWriter osw = new OutputStreamWriter(fos, "utf-8");
    osw.write("your text with Turkish characters...");Geoff

  • Issues writing to file with Jython

    Hi all,
    I want to write into a file the message of the previous step.
    We have created a procedure but we get this error below.
    How could we manage the <%=odiRef.getPrevStepLog("MESSAGE")%> in order to be written into the file?
    I guess we would have to replace but don't know what
    org.apache.bsf.BSFException: exception from Jython:
    Traceback (innermost last):
    (no code object) at line 0
    SyntaxError: ('Lexical error at line 6, column 123. Encountered: "\\n" (10), after : ""', ('<string>', 6, 123, "strMessage = '3290 : 42000 : java.sql.SQLException: ORA-03290: Invalid truncate command - missing CLUSTER or TABLE keyword"))
         at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:146)
         at com.sunopsis.dwg.codeinterpretor.k.a(k.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlS.treatTaskTrt(SnpSessTaskSqlS.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.h.y(h.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Unknown Source)
    The description of the error is:
    3290 : 42000 : java.sql.SQLException: ORA-03290: Invalid truncate command - missing CLUSTER or TABLE keyword
    java.sql.SQLException: ORA-03290: Invalid truncate command - missing CLUSTER or TABLE keyword
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:282)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:639)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:185)
         at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:633)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1086)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2984)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3057)
         at com.sunopsis.sql.SnpsQuery.executeUpdate(SnpsQuery.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execStdOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlS.treatTaskTrt(SnpSessTaskSqlS.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.h.y(h.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Unknown Source)
    Thanks

    There is nothing to gain in not putting the throws IOException in the write method, since the exception object will have the information about the actual problem.
    Is this a typo for the this post?                 this.roomsInList.add(huone); should be room nes pas.
    What exception is actually thrown? To find out useSystem.out.println("Exception: " + ioe);Then wonder why you have the AppartmentFileHandler implement Serializable when you are not writing that object to the file.

  • Troubles writing to file and printing characters above 127

    Hi,
    Whenever I write to a file or to the standard output (System.out), all characters above 127 are replaced by a question mark.
    I only started having this problem after upgrading to jdk 1.3.1, with previous version all was fine. I'm using slackware linux 7.0.
    output of java -version
    java version "1.3.1"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-b24)
    Java HotSpot(TM) Client VM (build 1.3.1-b24, mixed mode)
    After reading a lot about internationalization I still can't solve my problem.
    The output of the following code:
    System.out.println(java.util.Locale.getDefault().getDisplayName());
    System.out.println( System.getProperty("file.enconding"));
    is:
    English (United States)
    null
    Shouldn't the file.encoding property be set?
    I've tried setting it:
    System.out.println( System.setProperty("file.enconding","UTF8"));
    but the aplication simply hangs at that line.
    Please help!

    Hi,
    I am having similiar problem as posted by you in the message - ours is a web application hosted on Apache - JServ, JDK 1.2.1, Servlets, MySQL, and SunOS 5.6. We have recently upgraded to JDK 1.3.1 and SunOS 5.8.
    The application works fine except for the internationalization code.
    The web application support 8 languages. The application works fine for english but for asian languages (korean,japanese,traditional chinese,simplified chinese), all characters are replaced by question marks. Similarly some characters in latin based languages (german,french,italian)are replaced by question marks.
    I am wondering if you can share the solution - i think it should be applicable to us also.
    The mechanism used by us is to set the content type in the HTTPServletResponse object and use output stream writer to send localized information to browser:
    res.setContentType("text/html;charset=EUC_JP");
    OutputStreamWriter out = new BufferedWriter( new OutputStreamWriter(this.oHttpResponse.getOutputStream() ), 512 );
    Regards,
    Kapil Kapoor.

  • Duplicate namespace declarations when writing a file with JCA file adapter

    I am using JCA File adapter to write a an XML file. The composite contains a mediator which received and transforms an XML to desired format and then calls a JCA file adapter to write the file.
    The problem that I am having is that the written file has declaration of namespaces repeated with repeating elements instead of a single declaration at root. For ex.
    instead of
    <ns0:Root xmlns:ns0="namespace0"  xmlns:ns1="namespace1" xmlns:ns2="namespace2">
    <ns0:RepeatingChild>
    <ns1:Element1>value1</ns1:Element1>
    <ns2:Element2>value2</ns2:Element2>
    </ns0:RepeatingChild>
    <ns0:RepeatingChild>
    <ns1:Element1>value3</ns1:Element1>
    <ns2:Element2>value4</ns2:Element2>
    </ns0:RepeatingChild>
    </ns0:Root>What I see in the file is:
    <ns0:Root xmlns:ns0="namespace0"  xmlns:ns1="namespace1" xmlns:ns2="namespace2">
    <ns0:RepeatingChild>
    <ns1:Element1 xmlns:ns1="namespace1" xmlns:"namespace1">value1</ns1:Element1>
    <ns2:Element2 xmlns:ns2="namespace2" xmlns:"namespace2">>value2</ns2:Element2>
    </ns0:RepeatingChild>
    <ns0:RepeatingChild>
    <ns1:Element1 xmlns:ns1="namespace1" xmlns:"namespace1">>value3</ns1:Element1>
    <ns2:Element2 xmlns:ns2="namespace2" xmlns:"namespace2">>value4</ns2:Element2>
    </ns0:RepeatingChild>
    </ns0:Root>So basically all the elements which are in different namespace than root element have a namespace declaration repeated even though the namespace identifier is declared at the root elment level.
    Although, the XML is still valid, but this is unnecessarily increasing the filesizes 3-4 times. Is there a way I can write the XML file without duplicate declarations of namespaces?
    I am using SOA Suite 11.1.1.4
    The file adapter has the schema set as above XML.
    I tried the transformation in mediator using XSL and also tried using assign [source(input to mediator) and target(output of mediator, input of file adapter) XMLs are exactly same].
    but no success.

    I used automapper of JDeveloper to generate the schema. The source and target schema are exactly same.
    I was trying to figure it out and I observed that if the namespaces in question are listed in exclude-result-prefixes list in xsl, then while testing the XSL in jDeveloper duplicate namespaces occur in the target and if I remove the namespace identifiers from the exclude-result-prefixes list then in jDeveloper testing the target correctly has only a single namespace declaration at the root node.
    But, when I deployed the same to server and tested there, again the same problem.

  • Trouble converting RAW files with Camera RAW/DNG - CS4 Mac

    Hello!
    I am using CS4, with Camera RAW 5.7 and Adobe DNG 5.7.  These are the versions listed as compatible with CS4.  I am using a new Canon Powershot S100.  Can I use newer versions of the RAW/DNG with CS4, or am I just out of luck? Please help!
    caroline

    Same story we hear again and again.
    New camera, old software, and the often un-stated expectation that the software company should go out of its way to provide new camera support for free.  First thought by those in the know is "you bought a new camera, why do you feel you don't need to buy new software to go with it?"
    Those same folks who bought a new camera might never consider asking a camera manufacturer to make their new camera compatible with their old software.  It's a funny disparity.
    Adobe walks a tightrope of expectations.  As it turns out, when you download the latest free DNG converter version they actually DO provide new camera support for free - it's just that converting to an intermediate file format is not quite as integrated or convenient as using the latest version of Photoshop with native support for that camera to just open the files directly.  Nor do you get the SIGNIFICANT improvements in image quality that the newer converters provide.
    Use the DNG converter, but if you care about your image quality you'll consider upgrading Photoshop.  They really have made strides in raw conversion.
    -Noel

  • Trouble syncing iTunes files with iPod.  Help!

    Hi. Newbie, so be gentle.
    I have a lot of songs on my computer. Sometime in the past couple of months, something prevented me from updating certain song files (and the files would vary). What would happen is the iPod would go through the syncing process and get hung up on one song (visible in the the status bar in iTunes). After it gets hung up, the syncing process would stop and I'd get the "OK to disconnect" message, but the file never showed up. On occasion, deleting the song and attempting to resync would make the iPod usuable again (and then I'd just have to reload the song and try again--sometimes that would work, other times it wouldn't).
    After numerous problems with this, I talked to a rep at my local Apple store, who suggested that restoring my iPod would be the best solution. So I did. After taking multiple attempts to restore, I finally got the iPod blanked out. But now when it tries syncing to get all of my songs back, it again gets hung up on one song and stops attempting eventually. So from almost 5000 songs on my iPod, I've gone to 14.
    Please help! I don't want to buy another iPod (especially because I don't know whether this is a hardware issue with my iPod or a softeware issue with my iPod or iTunes--buying another iPod isn't a guarantee that the same thing won't happen). Hoe else can I troubleshoot this issue?

    Sad to say, but I think you have some corrupted music files.
    Those are the worst to filter through....
    My iPod was doing something similar. Wouldn't update. I finally found the bad file. It wouldn't play in WMP or winamp either, so it wasn't just iTunes being funky.
    Luckily mine were like, 5 bad files in a row. Otherwise it takes forever to isolate which ones are causing it.
    You could send feedback, I guess...if iTunes finds a bad file, then skip it, instead of shutting down the entire sync process. Maybe if enough of us send this suggestion, it will be implemented.

Maybe you are looking for