<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
I've taken a look at Text::CSV_XS and that looks like it will do
nicely. This would up being 2 threads... how to manipulate an array
and csv handling and I'm glad I got answers to both.<br>
<br>
Thanks everyone for your help on this.<br>
<br>
Dave<br>
<br>
On 7/2/2011 10:41 PM, <a class="moz-txt-link-abbreviated" href="mailto:scott.tanner@comcast.net">scott.tanner@comcast.net</a> wrote:
<blockquote
cite="mid:62737611.163499.1309660909965.JavaMail.root@sz0161a.emeryville.ca.mail.comcast.net"
type="cite">
<style type="text/css">p { margin: 0; }</style>
<div style="font-family: Arial; font-size: 12pt; color: rgb(0, 0,
0);">(Apologies is this came through twice.)<br>
<br>
David,<br>
I know this doesn't exactly answer your question, but I've used
the Text::CSV_XS module for a while to parse CSV files and have
had with good results. As Adam alluded to, CSV can get
squirrely pretty fast.<br>
<br>
<span class="Object" id="OBJ_PREFIX_DWT661"><a
moz-do-not-send="true" target="_blank"
href="http://search.cpan.org/%7Ehmbrand/Text-CSV_XS-0.82/CSV_XS.pm">http://search.cpan.org/~hmbrand/Text-CSV_XS-0.82/CSV_XS.pm</a></span><br>
<br>
<br>
Regards,<br>
Scott<br>
<br>
<br>
<br>
David Pembrook <<span class="Object" id="OBJ_PREFIX_DWT650"><span
class="Object" id="OBJ_PREFIX_DWT651"><a class="moz-txt-link-abbreviated" href="mailto:david@pembrook.net">david@pembrook.net</a></span></span>>
wrote:<br>
>I'm fluent enough in perl to be dangerous. I have a line
from a csv <br>
>file and I want the "columns" in an array without any
quotes. Some <br>
>columns have them, some don't so I can't count on their
presence.<br>
>The quick and dirty way I came up with used a temp array and
a counter <br>
>and know that has to be a better way to handle this.<br>
> while (<FILE>) {<br>
> @temp_values2 = split(",", $_);<br>
<br>
String splitting is an evil and wrong way to read a delimited
record;<br>
doing so will fail in a fantastic variety of ways. I'm not a
Perl<br>
developer but I'm certain Perl must provide a standard module
for<br>
reading delimited data sets. In Python this would be the "csv"
module -<br>
which allows you to specify field delimiter, line terminator,
and field<br>
quoting style. Don't forget that text files also have encoding
- one<br>
cannot assume text data is ASCII (especially if a user can get
anywhere<br>
near it using cut-n-paste). If it isn't straight-ASCII your
string<br>
splitting will fail in mysterious cases that on visual
inspection look<br>
fine.<br>
<br>
-- <br>
Adam Tauno Williams</div>
<br>
-- <br>
This message has been scanned for viruses and
<br>
dangerous content by
<a moz-do-not-send="true" href="http://www.mailscanner.info/"><b>MailScanner</b></a>,
and is
<br>
believed to be clean.
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
grlug mailing list
<a class="moz-txt-link-abbreviated" href="mailto:grlug@grlug.org">grlug@grlug.org</a>
<a class="moz-txt-link-freetext" href="http://shinobu.grlug.org/cgi-bin/mailman/listinfo/grlug">http://shinobu.grlug.org/cgi-bin/mailman/listinfo/grlug</a></pre>
</blockquote>
<br />--
<br />This message has been scanned for viruses and
<br />dangerous content by
<a href="http://www.mailscanner.info/"><b>MailScanner</b></a>, and is
<br />believed to be clean.
</body>
</html>