Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Trying to find missing closing quotes in CSV

by kcott (Archbishop)
on Sep 16, 2013 at 23:13 UTC ( [id://1054349]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ cat -vet test.csv
    quote at end"$
    no quote at end$
    quote and space at end" $
    quote and tab at end"^I$
    
  2. or download this
    $ perl -ne 'print $_ if $_ =~ /[^"]$/' < test.csv
    quote at end"
    no quote at end
    quote and space at end" 
    quote and tab at end"
    
  3. or download this
    $ perl -ne 'print ">>>$_<<<\n" if $_ =~ /[^"]$/' < test.csv
    >>>quote at end"
    ...
    <<<
    >>>quote and tab at end"    
    <<<
    
  4. or download this
    $ perl -lne 'print $_ if $_ =~ /[^"]$/' < test.csv
    no quote at end
    quote and space at end" 
    quote and tab at end"
    
  5. or download this
    $ perl -ne 'chomp; print "$_\n" if $_ =~ /[^"]$/' < test.csv
    no quote at end
    quote and space at end" 
    quote and tab at end"
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1054349]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (6)
As of 2024-04-18 13:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found