Hi,
I made a csv file on a windows machine, its contents are just like:
5 10 15
2 4 6
3 6 9
I tokenize the input, then just print the matrix as a test. I print brackets around the numbers. It works fine on a windows machine. It looks like:
Row 0: [5] [10] [15]
Row 1: [2] [4] [6]
Row 2: [3] [6] [9]
When I move to a solaris machine running perl 5.8.8, for some reason, the closing bracket that was supposed to be at the end of the line eats what was supposed to be the first character in the line! The last printed line looks ok:
]ow 0: [5] [10] [15
]ow 1: [2] [4] [6
Row 2: [3] [6] [9]
My print statements are just like:
print("Row", $r, ": ");
# for all columns
print("[");
print($token);
print("]");
#end all columns
print("\n");
It's definitely something with the value of $token. If I remove that print statement, everything gets printed fine. I'm thinking that since I made the csv file on a windows machine, it's got some windows character for a new line that is making the output get messed up on the solaris machine?
Is there a way to completely trim any junk off the end of the token to see if that's a problem?
Thanks
Start Free Trial