Perl format string

K

kejoseph

I want to use Perl to format a CSV text file so that I can easily
convert it to pdf. The CSV text file has 10 fields each of variable
length. I want Perl to format it so that the field length is
controlled. Anything over the field length should be truncated.

I know of various perl methods, substr, printf to achieve the above,
but am sending this e-mail to find out whether anyone has any other
elegant way of performing this task.

Kevin.
 
L

lynn

Hi Kevin,


I want to use Perl to format a CSV text file so that I can easily
convert it to pdf.
Kevin.

Z:\>perl -MCPAN -e shell
Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v1.7601)
ReadLine support available (try 'install Bundle::CPAN')

cpan> i /CSV/
CPAN: Storable loaded ok

Bundle Bundle::DBD::CSV (J/JZ/JZUCKER/DBD-CSV-0.22.tar.gz)

(much snippage)

64 items found


That should get you started. Hope this helps

Lynn
 
A

A. Sinan Unur

(e-mail address removed) wrote in @g14g2000cwa.googlegroups.com:
I want to use Perl to format a CSV text file so that I can easily
convert it to pdf. The CSV text file has 10 fields each of variable
length. I want Perl to format it so that the field length is
controlled. Anything over the field length should be truncated.

I know of various perl methods, substr, printf to achieve the above,
but am sending this e-mail

This is not email.
to find out whether anyone has any other elegant way of performing
this task.

Please read the posting guidelines for this group to learn how you can
help yourself, and help others help you.

Sinan
 
G

George

I want to use Perl to format a CSV text file so that I can easily
convert it to pdf. The CSV text file has 10 fields each of variable
length. I want Perl to format it so that the field length is
controlled. Anything over the field length should be truncated.

I know of various perl methods, substr, printf to achieve the above,
but am sending this e-mail to find out whether anyone has any other
elegant way of performing this task.

Kevin.

your answer is in your own subject line
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top