[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
- <!--x-content-type: text/plain -->
- <!--x-date: Fri Jul 8 09:22:53 2005 -->
- <!--x-from-r13: syrgpu ng culqrnhk.bet (Tyrgpu) -->
- <!--x-message-id: [email protected] -->
- <!--x-reference: [email protected] --> "http://www.w3.org/TR/html4/loose.dtd">
- <!--x-subject: [ale] Parsing CSV file in perl -->
- <li><em>date</em>: Fri Jul 8 09:22:53 2005</li>
- <li><em>from</em>: fletch at phydeaux.org (Fletch)</li>
- <li><em>in-reply-to</em>: <<a href="msg00078.html">[email protected]</a>> (Christopher Fowler's message of "Wed, 06 Jul 2005 16:38:42 -0400")</li>
- <li><em>references</em>: <<a href="msg00078.html">[email protected]</a>></li>
- <li><em>subject</em>: [ale] Parsing CSV file in perl</li>
Christopher> I'm trying to parse a CSV file in perl and I'm having
Christopher> a issue with some of the columns being blank.
Install Text::CSV_XS and then try something like:
use Text::CSV_XS ();
my $csv = Text::CSV_XS->new( { sep_char => "\t", } );
while( <> ) {
chomp;
my $status = $csv->parse( $_ );
my @cur = $csv->fields;
## ...
}
--
Fletch | "If you find my answers frightening, __`'/|
fletch at phydeaux.org| Vincent, you should cease askin' \ o.O'
| scary questions." -- Jules =(___)=
| U
</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00078" href="msg00078.html">[ale] Parsing CSV file in perl</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Christopher Fowler)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00094.html">[ale] SUSE LINUX 9.3 ISO images Released to Mirrors</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00096.html">[ale] Collocating non-rackable boxen</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00082.html">[ale] Parsing CSV file in perl</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00097.html">[ale] Parsing CSV file in perl</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00095"><strong>Date</strong></a></li>
<li><a href="threads.html#00095"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>
<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>