Hello all, I'm having some difficulty reading a .csv file in Perl. I am trying to read a number of files containing data in specific columns where some of the columns contain superscript and some other interesting characters. For some reason Perl is not able to read them and just outputs them as a question mark with a black circle behind it. Below are the column headers giving me problems followed by the code I use to draw them out:
405nm Data: Nº of Objects(Nº)
405nm Data: Total 1º Area(µm²)
405nm: single cells: Mean 1º Area(µm²)
405nm: Sub G1: Nº of Objects(Nº)
405nm: Cell: Nº of Objects(Nº)
#!/usr/bin/perl use strict; my $sql; my $line; my @words; my $tag; open (FILE, "test.txt") || "Cannot open file: $!"; while ($line = <FILE>) { print $line; chomp $line; @words = split(/\t\s*/, $line); last; } foreach $tag (@words) { print $tag."\n"; }
Any help would be greatly appreciated!
thanks,
Haakon
In reply to Odd symbols in read file function? by hberven1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |