Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > request for CSV converter program

Reply
Thread Tools

request for CSV converter program

 
 
Jeffrey
Guest
Posts: n/a
 
      04-16-2005
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.

 
Reply With Quote
 
 
 
 
Rhino
Guest
Posts: n/a
 
      04-16-2005

"Jeffrey" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> 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


 
Reply With Quote
 
 
 
 
Betty
Guest
Posts: n/a
 
      04-16-2005

"Jeffrey" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> 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();


 
Reply With Quote
 
Robert
Guest
Posts: n/a
 
      04-17-2005
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/

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Moyea Video Converter with iPad video converter brntkobe1 Computer Support 0 04-18-2010 08:22 AM
CSV to C struct converter Malcolm McLean C Programming 0 05-31-2007 08:06 PM
CSV to array converter tom t/LA Javascript 14 03-25-2007 08:55 AM
csv writerow creates double spaced excel csv files Michal Mikolajczyk Python 0 02-13-2004 08:38 PM
Re: Accessing Request.InputStream / Request.BinaryRead *as the request is occuring*: How??? Brian Birtle ASP .Net 2 10-16-2003 02:11 PM



Advertisments