request for CSV converter program

J

Jeffrey

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.
 
R

Rhino

Jeffrey said:
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
 
B

Betty

Jeffrey said:
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();
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top