Zapawork has asked for the wisdom of the Perl Monks concerning the following question:
However, if i run split and print it out i get:"ÿþ"\x00N\x00a\x00m\x00e\x00.\x00I\x00D\x00"\x00,\x00"\x00P\x00I\x00N\ +x00"\x00,\x00"\x00E\x00m\x00a\x00i\x00l\x00 \x00A\x00d\x00d\x00r\x00e +\x00s\x00s\x00"\x00,\x00"\x00T\x00y\x00p\x00e\x00 \x00o\x00f\x00 \x00 +M\x00e\x00s\x00s\x00a\x00g\x00e\x00"\x00,\x00"\x00T\x00o\x00"\x00,\x0 +0"\x00C\x00c\x00"\x00,\x00"\x00B\x00c\x00c\x00"\x00,\x00"\x00F\x00r\x +00o\x00m\x00"\x00,\x00"\x00S\x00u\x00b\x00j\x00e\x00c\x00t\x00"\x00,\ +x00"\x00B\x00o\x00d\x00y\x00"\x00,\x00"\x00S\x00e\x00n\x00d\x00/\x00R +\x00e\x00c\x00e\x00i\x00v\x00e\x00d\x00 \x00D\x00a\x00t\x00e\x00"\x00 +,\x00"\x00S\x00e\x00r\x00v\x00e\x00r\x00 \x00L\x00o\x00g\x00 \x00D\x0 +0a\x00t\x00e\x00"\x00,\x00"\x00O\x00v\x00e\x00r\x00a\x00l\x00l\x00 \x +00M\x00e\x00s\x00s\x00a\x00g\x00e\x00 \x00S\x00t\x00a\x00t\x00u\x00s\ +x00"\x00,\x00"\x00C\x00o\x00m\x00m\x00a\x00n\x00d\x00"\x00,\x00"\x00U +\x00I\x00D\x00"\x00" <br><br> for any match that i do and any print that i do.
What is going on here? I need to do a regex match and print the string normally."Name.ID","PIN","Email Address","Type of Message","To","Cc","Bcc","Fro +m","Subject","Body","Send/Received Date","Server Log Date","Overall M +essage Status","Command","UID"
open FILE, "<", $file or die "open: $!"; while (<FILE>) { my $line2 = $_; chomp $line2; my @line = split (/","/,$line2); if ( $line[0] =~ m/Name.ID/) { print "here \n"; next; } else { print "$line[0] \n"; } print "$line[0],$line[1],$line[2],$line[3],$line[4],$line[ +5],$line[6],$line[7],$line[8],$line[9],$line[10],$line[11],$line[12], +$line[13],$line[14]"; } } }
ÿþ" "Name.ID","PIN","Email Address","Type of Message","To","Cc","Bcc","Fro +m","Subject","Body","Send/Received Date","Server Log Date","Overall M +essage Status","Command","UID"ⰬⰬⰬⰬⰬ +;ⰬⰬ
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Dealing with strange data encoding issue
by jhourcle (Prior) on Feb 20, 2009 at 17:13 UTC | |
by ikegami (Patriarch) on Feb 20, 2009 at 23:23 UTC | |
by Zapawork (Scribe) on Feb 20, 2009 at 22:19 UTC | |
|
Re: Dealing with strange data encoding issue
by Bloodnok (Vicar) on Feb 20, 2009 at 18:32 UTC |