GreazyMcgeezy
Technical User
I'm looking for assistance with an issue I'm having on this log file. Basically all I'm trying to do is open a file and save it into an array for searching. On a small test.txt file that I created with a few lines, it does this no problem and prints elements of the array without issues. I have a log file that is much larger that I wanted to use for testing and practice, but every time I load it into the array the same way as the sample text file, for some reason it gets a space added between every character. Can you point me in the right direction of why?
Here is the original line in the file:
Here is the output once it's been loaded to the array and printed as $raw[0]:
As you can see, there is an additional space between EVERY character... I have no clue why. It also appears in the command window like every character is in it's unique column. So looking back through the code everything lines up so that all visible characters are in the same lines. The 'spaced columns' have no characters in them.
Thanks in advance!
Perl:
use feature ':5.10';
my $file = <STDIN>;
open (FH, $file);
my @raw = <FH>;
close (FH);
print $raw[0];
Here is the original line in the file:
Code:
=== Verbose logging started: 5/1/2012 3:00:40 Build type: SHIP UNICODE 3.01.4001.5512 Calling process: c:\96a3e4c72f1c1c4b5d35fb9c55a993\x86\Setup.exe ===
Here is the output once it's been loaded to the array and printed as $raw[0]:
Code:
■= = = V e r b o s e l o g g i n g s t a r t e d : 5 / 1 / 2 0 1 2
3 : 0 0 : 4 0 B u i l d t y p e : S H I P U N I C O D E 3 . 0 1 . 4
0 0 1 . 5 5 1 2 C a l l i n g p r o c e s s : c : \ 9 6 a 3 e 4 c 7 2 f
c 1 c 4 b 5 d 3 5 f b 9 c 5 5 a 9 9 3 \ x 8 6 \ S e t u p . e x e = = =
As you can see, there is an additional space between EVERY character... I have no clue why. It also appears in the command window like every character is in it's unique column. So looking back through the code everything lines up so that all visible characters are in the same lines. The 'spaced columns' have no characters in them.
Thanks in advance!