Results 1 to 6 of 6
  1. #1
    nida is offline Member
    Join Date
    Mar 2009
    Posts
    14
    Rep Power
    0

    Default Import error for csv file in outlook

    Hi,
    I have exported my contacts in a csv file , file is created but when i import it into outlook following error message is displayed:

    File error has encountered in csv(window) translator while initializing translator to build field map .

    But when i open the csv file and save it as in CSV format again , it is imported without any error,

    Following is the code to create csv File:

    CSVWriter writers = new CSVWriter(new FileWriter("c:\\Contacts.csv"), ',');
    writers.writeNext(header);
    writers.writeAll(pda.getContacts(login_id), false);
    writers.close();
    can any one help me?
    Thanks.
    Last edited by nida; 05-21-2009 at 02:45 PM.

  2. #2
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    Default

    And what package is CSVWriter in?
    Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
    How To Ask Questions The Smart Way

  3. #3
    nida is offline Member
    Join Date
    Mar 2009
    Posts
    14
    Rep Power
    0

    Default

    it's com , r u asking about???

  4. #4
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default

    > when i import it into outlook following error message is displayed:

    Microsoft plays fast and loose with formats, so it quite possible that opening and saving the file again in whatever their spreadsheet app is called will result in a csv file that Outlook will use without complaining.

    Some Java csv libraries (like Ostermiller's) give you an option of saving in a format that Microsoft can understand. But OD is right: you really have to say what package this CSVWriter you are using comes from. It isn't a standard Java class - so unless you say, no-one can know the first thing about it.

  5. #5
    gwachnitz is offline Member
    Join Date
    Sep 2012
    Posts
    1
    Rep Power
    0

    Default Re: Import error for csv file in outlook

    Quote Originally Posted by nida View Post
    Hi,
    I have exported my contacts in a csv file , file is created but when i import it into outlook following error message is displayed:

    File error has encountered in csv(window) translator while initializing translator to build field map .

    But when i open the csv file and save it as in CSV format again , it is imported without any error,

    Following is the code to create csv File:

    CSVWriter writers = new CSVWriter(new FileWriter("c:\\Contacts.csv"), ',');
    writers.writeNext(header);
    writers.writeAll(pda.getContacts(login_id), false);
    writers.close();
    can any one help me?
    Thanks.
    I had a similar problem, in my case it was that outlook does not understand unis system EOL... so when you build the CSV text make sure to add an \r before the \n after each line.

    Hope it helps!!
    Germán Wachnitz

  6. #6
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,458
    Rep Power
    20

    Default Re: Import error for csv file in outlook

    Three year old zombie, locking.

    db

    THREAD CLOSED
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Replies: 6
    Last Post: 02-10-2011, 10:55 AM
  2. error with import java.io.*
    By osval in forum New To Java
    Replies: 5
    Last Post: 05-13-2010, 06:03 PM
  3. how to import a ejb bean in java file
    By vijayinani in forum Enterprise JavaBeans (EJB)
    Replies: 2
    Last Post: 06-30-2009, 11:05 PM
  4. how to import war file with tomcat?
    By makpandian in forum NetBeans
    Replies: 0
    Last Post: 12-31-2008, 12:00 PM
  5. Pre-Populating an Outlook Email
    By KeithHenn in forum Advanced Java
    Replies: 3
    Last Post: 10-23-2008, 04:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •