Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It appears that most of those quotes are being inserted by your command to bring in the file. Instead open the file normally:</p> <pre><code>use strict; use warnings; open CSV, 'test.csv' or die "can't open input file."; open TAB, '&gt;test.tab' or die "can't open output file."; my @row_array; while (&lt;CSV&gt;) { #Remove any quotes that exist on the line (it is in default variable $_). s/"//g; #Split the current row into an array. my @fields = split /,/; #write the output, tab-delimited file. print TAB join ("\t", @fields) . "\n"; #Put the row into a multidimensional array. push @row_array, \@fields; } print "Column 4:\n"; print $_-&gt;[3] . "\n" foreach (@row_array); print "\nColumns 1-3:\n"; print "@{$_}[0..2]\n" foreach (@row_array); </code></pre> <p>Any quotes that still do exist will be removed by <code>s/"//g;</code> in the above code. This will remove <em>all</em> quotes; it doesn't check whether they are at the beginning and end of a field. If you might have some quotes within the data that you need to preserve, you would need a more sophisticated matching pattern.</p> <p><strong>Update:</strong> I added code to create a tab-separated output file, since you seem to want that. I don't understand exactly what your requirement related to getting "all the names...and the coordinates" is. However, you should be able to use the above code for that. Just add what you need where it says "do stuff". You can reference, for example, column 1 with <code>$fields[0]</code>. </p> <p><strong>Update 2:</strong> Added code to extract column 4, then columns 1-3. The syntax for using multidimensional arrays is tricky. See <a href="http://perldoc.perl.org/perldsc.html#ARRAYS-OF-ARRAYS" rel="nofollow">perldsc</a> and <a href="http://perldoc.perl.org/perlref.html" rel="nofollow">perlref</a> for more information.</p> <p><strong>Update 3:</strong> Added code to remove the quotes that still exist in your file.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload