request for CSV converter program

Discussion in 'Java' started by Jeffrey, Apr 16, 2005.

  1. Jeffrey

    Jeffrey Guest

    I guess some of you might have written some utility programs that allow
    you to convert a CSV file to another CSV file with fewer columns and
    having some field values mapped according to some rules.

    I am looking for a similar solution to help my poor colleague to
    simplify his daily manual work to reformat several CSV files using
    excel.
     
    Jeffrey, Apr 16, 2005
    #1
    1. Advertising

  2. Jeffrey

    Rhino Guest

    "Jeffrey" <> wrote in message
    news:...
    > I guess some of you might have written some utility programs that allow
    > you to convert a CSV file to another CSV file with fewer columns and
    > having some field values mapped according to some rules.
    >
    > I am looking for a similar solution to help my poor colleague to
    > simplify his daily manual work to reformat several CSV files using
    > excel.
    >


    First, I'm not really sure what you mean by converting a CSV file to another
    that has fewer columns and has some field values mapped according to some
    rules. It's a very vague description of what you want and I don't get a
    clear picture of what you mean. A simple example of what you mean would be
    useful.

    Second, I don't see anything in the description of the problem that
    especially lends itself to Java, as opposed to the umpteen other programming
    languages out there. In fact, it sounds like more of a batch utility to me
    than a Java program. If I were going to write something like that, I might
    be more inclined to use a BASH script or REXX or one of the Linux utilities.
    There are many script-type languages out there that do a very good job with
    this kind of task and carry a lot less overhead than Java.

    You might get a better answer on the newsgroups associated with those
    languages.

    Rhino
     
    Rhino, Apr 16, 2005
    #2
    1. Advertising

  3. Jeffrey

    Betty Guest

    "Jeffrey" <> wrote in message
    news:...
    > I guess some of you might have written some utility programs that allow
    > you to convert a CSV file to another CSV file with fewer columns and
    > having some field values mapped according to some rules.
    >
    > I am looking for a similar solution to help my poor colleague to
    > simplify his daily manual work to reformat several CSV files using
    > excel.
    >

    It is probably easier in Perl or Python, but if you want to
    use Java you can read the file a line at a time using something like
    while ((line = in.readLine()) != null)
    then split the string into smaller strings
    String columns[] = line.split(",");
    // your magic goes here
    then output the columns you want
    out.print(columns[0]+","+columns[1]+"," .....
    out.println();
     
    Betty, Apr 16, 2005
    #3
  4. Jeffrey

    Robert Guest

    Check out the Ostermiller java utilities. He has a CSV parser or
    printer or something and a special excel compatible one as well, I
    think.

    http://ostermiller.org/utils/
     
    Robert, Apr 17, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian Birtle
    Replies:
    2
    Views:
    2,099
    John Saunders
    Oct 16, 2003
  2. Jeremy Cowles
    Replies:
    2
    Views:
    418
    Jeremy Cowles
    Jul 29, 2003
  3. Nicolas Matringe

    Another Verilog to VHDL converter request

    Nicolas Matringe, Feb 5, 2007, in forum: VHDL
    Replies:
    11
    Views:
    3,965
    Nicolas Matringe
    Feb 7, 2007
  4. Malcolm McLean

    CSV to C struct converter

    Malcolm McLean, May 31, 2007, in forum: C Programming
    Replies:
    0
    Views:
    594
    Malcolm McLean
    May 31, 2007
  5. tom t/LA

    CSV to array converter

    tom t/LA, Mar 18, 2007, in forum: Javascript
    Replies:
    14
    Views:
    273
    Evertjan.
    Mar 25, 2007
Loading...

Share This Page