Results 1 to 8 of 8
  1. #1
    javalearner is offline Member
    Join Date
    Nov 2013
    Posts
    4
    Rep Power
    0

    Default Import and Export Files in Java

    Hello Everyone,

    I am a beginner who is trying to make a small java app which allows importing files (CSV, XML, etc) and exporting files in (CSV, XML, etc)

    Can anyone point me to the right set of resources where I can read and get the guidance for the same.

    Thanks a lot for your time

    --
    Java Beginner

  2. #2
    jim829 is online now Senior Member
    Join Date
    Jan 2013
    Location
    United States
    Posts
    2,924
    Rep Power
    4

    Default Re: Import and Export Files in Java

    Are you asking how to import/export them into/from Eclipse?

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  3. #3
    javalearner is offline Member
    Join Date
    Nov 2013
    Posts
    4
    Rep Power
    0

    Default Re: Import and Export Files in Java

    [QUOTE=jim829;362869]Are you asking how to import/export them into/from Eclipse?


    No, I want to make a JAVA application that allows import and export of CSV files
    Thanks a lot for your guidance.

  4. #4
    jim829 is online now Senior Member
    Join Date
    Jan 2013
    Location
    United States
    Posts
    2,924
    Rep Power
    4

    Default Re: Import and Export Files in Java

    Well, CSV files are relatively easy. You just need to read in the information and split on the delimiter. But you say you are a beginner so I would recommend reading up on the The Java™ Tutorials and syntax first. Otherwise, your task will somewhat frustrating.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  5. #5
    SurfMan's Avatar
    SurfMan is online now Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    723
    Rep Power
    2

    Default Re: Import and Export Files in Java

    Quote Originally Posted by jim829 View Post
    Well, CSV files are relatively easy.
    They are indeed, but it depends on how far you want to take it. There is no real CSV standard, although attempts have been made.

    You'll run into challenges when your values contain the separator itself, then you would have to use quotes. And then your values contain quotes which you have to escape with another quote. There's more to it than meets the eye. Here's a nice list of requirements from Wikipedia:

    -DOS-style lines that end with (CR/LF) characters (optional for the last line)
    -An optional header record (there is no sure way to detect whether it is present, so care is required when importing).
    -Each record "should" contain the same number of comma-separated fields.
    -Any field may be quoted (with double quotes).
    -Fields containing a line-break, double-quote, and/or commas should be quoted. (If they are not, the file will likely be impossible to process correctly).
    -A (double) quote character in a field must be represented by two (double) quote characters.

    To the OP I would suggest to get the basic requirements implemented. Then move on to the more challenging features :) The String class has lots of useful methods for splitting a String into pieces.
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2™ © 2013

  6. #6
    javalearner is offline Member
    Join Date
    Nov 2013
    Posts
    4
    Rep Power
    0

    Default Re: Import and Export Files in Java

    Thank you for giving the real useful tips - I'll get started now! Thanks a lot everyone for your valuable time and tips!

    N.B: I am making this java application in the eclipse IDE, it'll be really helpful if you could please refer some step by step tutorial, many thanks!
    Last edited by javalearner; 11-20-2013 at 08:45 PM.

  7. #7
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,082
    Rep Power
    4

    Default Re: Import and Export Files in Java

    No you're not making it in the Eclipse IDE, you're making it using Java. The IDE is just a nice little shell around that. Check youtube if you are the kind that wants to be shown how to do things, I'd rather invest in books if I were you and get to the real truth and understanding a lot quicker.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  8. #8
    javalearner is offline Member
    Join Date
    Nov 2013
    Posts
    4
    Rep Power
    0

    Default Re: Import and Export Files in Java

    gimbal2

    thanks for your response, yes 100% agree with your view point. Buying/referring books will be a lot quicker and effective for a better understanding.

    Can you recommend any book(s)?

    Thanks for your time and guidance!

    --
    cheers,
    JavaLearner

Similar Threads

  1. Replies: 0
    Last Post: 05-08-2012, 07:27 PM
  2. Replies: 0
    Last Post: 09-26-2011, 01:38 PM
  3. import from dsv files and export to csv files
    By 10x2 in forum New To Java
    Replies: 12
    Last Post: 04-30-2010, 11:56 AM
  4. Import / Export Issue
    By Gideonzx in forum Eclipse
    Replies: 0
    Last Post: 07-23-2009, 08:08 PM

Tags for this Thread

Posting Permissions

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