M6 KVM avatar M6 KVM committed 3697436 Draft

Name the CSV

Comments (0)

Files changed (1)

  use Text::CSV;
+ my $file = 'Applications_by_Computer_2012-11-21.csv';
  my @rows;
  my $csv = Text::CSV->new ( { binary => 1 } )  # should set binary attribute.
                  or die "Cannot use CSV: ".Text::CSV->error_diag ();
- open my $fh, "<:encoding(utf8)", "test.csv" or die "test.csv: $!";
+ open my $fh, "<:encoding(utf8)", $file or die "$file $!";
  while ( my $row = $csv->getline( $fh ) ) {
      $row->[2] =~ m/pattern/ or next; # 3rd field should match
      push @rows, $row;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.