camotito wrote:
I am using perl on msys in a windows operating system.
I was manipulating a file with .TAB extension. This is a file with 10
(or so) columns separated by tabs.
I store each line in an array, after doing modifications to a couple
of fields I print the array in another file using this line :
print FHO "@values\n";
The program I am using (that is running over windows) can only read
the first line in the modified file. When I open the modified file
with notepad I see an square at the end of each line.And all the lines
are in one line.
Did you possibly modify the file in a *nix environment? In that case,
"\n" represents \012, while the newline symbol on Windows is \015\012.
Read more about this in "perldoc perlport".
The original .TAB file doesn't show that square character, and the
lines appear one below each other.
Wich character should I use to have a file similar to the original
one? And also, how can I print an array so there are tabs between the
different fields, instead of a single space?
Again, if you are doing the mods on *nix, this might be what you want:
print FHO join("\t", @values), "\015\012";
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/