in reply to Re: ASCII insert after read
in thread ASCII insert after read
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: ASCII insert after read
by moritz (Cardinal) on Jul 30, 2008 at 13:26 UTC | |
It would help if you could provide a small script along with some sample input data and your desired output. Then we can help you better. | [reply] |
by Anonymous Monk on Jul 30, 2008 at 18:26 UTC | |
When I read in the text line by line, I can check for the 014 shift out ASCII character however when I use the print OUT $line the ASCII character is wrong. here is my code
| [reply] [d/l] [select] |
by moritz (Cardinal) on Jul 30, 2008 at 18:41 UTC | |
$hash->{$i} = printf("$line %d",$_); This line seems so wrong to me. printf prints something to STDOUT, and returns 1 on success. So this will basically store 1 in $hash->{$i}. Also the hash keys are always numerical - why use a hash at all? An array seems much more appropriate, and easier to handle.
Programming is mostly having the computer do the boring repetitions for you. No need for something like this, you have loops in Perl. When I read in the text line by line, I can check for the 014 shift out ASCII character however when I use the print OUT $line the ASCII character is wrong. If you don't tell me what "wrong" means to you I can't help you. The output does contain a 014 character, but if you view it in a browser I guess you don't see it. hexdump is very well suited to inspect the output. | [reply] [d/l] [select] |
by monkjeff (Initiate) on Jul 30, 2008 at 14:16 UTC | |
| [reply] |