[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



    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>