Sathish has asked for the wisdom of the Perl Monks concerning the following question:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: %p issue on perl script
by ikegami (Patriarch) on Sep 10, 2009 at 17:10 UTC | |
You're treating the contents of $row and $col as a sprintf format sequence. Change
to
If you wanted to to interpolate the values into the format string because you were using the same format string over and over again, you'd need to convert instances of "%" to "%%".
| [reply] [d/l] [select] |
|
Re: %p issue on perl script
by bv (Friar) on Sep 10, 2009 at 17:15 UTC | |
Your problem is that you are interpolating variables into a format string for printf. You should pick one way or the other: print or printf. More detailed explanation: %p in a printf or sprintf format string prints a pointer, which is coming out as a string of hex digits. Your statement, using printf, should be more like this:
or using print, like this: print " $feedback_value At ($row, $col) the row is $my_row and the column is $my_column for EUR & NAM \n";Your second issue is related to Unicode encodings, but I'm afraid I can't help more (ASCII-only for me, so far). If you reformat your question using <code></code> tags, or repost the second question on its own, you'll be more likely to get a helpful response.
print pack("A25",pack("V*",map{1919242272+$_}(34481450,-49737472,6228,0,-285028276,6979,-1380265972)))
| [reply] [d/l] [select] |
by Sathish (Initiate) on Sep 11, 2009 at 04:25 UTC | |
Many thanks for you help. The %p issue got solved after i changed "printf" to "print" as you suggested. Below is the code snippet for my second issue (Unicode encodings)
In the Voice.xls sheet on a particular cell the content is some italy language (other than english) (i cant print since it prints like ???????. ???????) When i try to print that cell contents to a CSV file it prints as ???????. ??????? I am not aware of unicode strings please help me on this I got some idea about the issue. This is not because of unicode encodings because the string which causing the problem is not a unicode it is an mandarin language string How do i print a mandarin language string in a spread sheet? Please help me on this........ | [reply] [d/l] |
by bv (Friar) on Sep 11, 2009 at 14:17 UTC | |
Glad I could help. As I said before, you should post this second problem in a new question. This one won't get the attention you need to answer it. I can only point you to the documentation: perlunicode
print pack("A25",pack("V*",map{1919242272+$_}(34481450,-49737472,6228,0,-285028276,6979,-1380265972)))
| [reply] [d/l] |
by Sathish (Initiate) on Sep 16, 2009 at 16:44 UTC | |
by Anonymous Monk on Sep 16, 2009 at 16:47 UTC | |
| |
by Sathish (Initiate) on Sep 16, 2009 at 16:46 UTC | |
Hi, Some how i solved the second issue. I set the font to that spread sheet as below and now i dont have any issue in printing non-english strings.
But again i stuck up with another issue on printing the string into a spreadsheet. I am printing a string into an spreadsheet with an row input from an for loop. Below is the code snippet of an for loop for better understanding.
Here the problem comes from an "Range". I am getting an error when i run this program an error pointing to "Range". Please suggest me an idea on how to input the "Range" with an variable size so that i can print an array $gm_out$ix into the variable ranges of ROW in the columns A, B, C & D. Please provide your help | [reply] [d/l] [select] |
|
Re: %p issue on perl script
by Anonymous Monk on Sep 10, 2009 at 17:00 UTC | |
You pressed the preview button, and then, seeing the horrible mess you made, decided to submit it anyways. Ugh. If you don't care enough about your question to make it legible, you should not expect others to care enough about your question to puzzle it out. Right below the buttons you clicked twice are: The forced preview is there for just this reason. | [reply] |