Re: formatting a list

2013-10-01 Thread Charles DeRykus
, 2013 8:49 AM *Subject:* Re: formatting a list On Fri, 27 Sep 2013 22:59:01 -0700 (PDT) Rajeev Prasad rp.ne...@yahoo.com wrote: ... I'm not bucking for net nanny but, while full solutions and follow-on discussions can be enlightening, I wonder if they're really advantageous to the OP

Re: formatting a list

2013-09-30 Thread Rajeev Prasad
thank you Shawn. this works nicely for me. From: Shawn H Corey shawnhco...@gmail.com To: beginners@perl.org Cc: Rajeev Prasad rp.ne...@yahoo.com Sent: Saturday, September 28, 2013 8:49 AM Subject: Re: formatting a list On Fri, 27 Sep 2013 22:59:01 -0700

Re: formatting a list

2013-09-28 Thread Shlomi Fish
Hi Rajeev, On Fri, 27 Sep 2013 22:59:01 -0700 (PDT) Rajeev Prasad rp.ne...@yahoo.com wrote: hello, following is obtained by concatenating 3 values using an underscore to produce a list: abc_12_4567 xy4z_xtr4_sdf PQRSDR_xcvf_scc234 i want them to look neat, something like this: where

Re: formatting a list

2013-09-28 Thread Logust Yu
Hi Rajeev, I guess you can use printf to print them into strings, and then replace the spaces with underscores. Regards, Jing 2013/9/28 Rajeev Prasad rp.ne...@yahoo.com hello, following is obtained by concatenating 3 values using an underscore to produce a list: abc_12_4567

Re: formatting a list

2013-09-28 Thread Logust Yu
ofc it should be sprintf... 2013/9/28 Rajeev Prasad rp.ne...@yahoo.com hello, following is obtained by concatenating 3 values using an underscore to produce a list: abc_12_4567 xy4z_xtr4_sdf PQRSDR_xcvf_scc234 i want them to look neat, something like this: where they look in line. I

Re: formatting a list

2013-09-28 Thread Shlomi Fish
Hi Jing, On Sat, 28 Sep 2013 16:53:20 +0800 Logust Yu logus...@googlemail.com wrote: Hi Rajeev, I guess you can use printf to print them into strings, and then replace the spaces with underscores. The problem with using sprintf and a replace operation like that, like you suggest is that it

Re: formatting a list

2013-09-28 Thread Rob Dixon
On 28/09/2013 06:59, Rajeev Prasad wrote: hello, following is obtained by concatenating 3 values using an underscore to produce a list: |abc_12_4567 xy4z_xtr4_sdf PQRSDR_xcvf_scc234| i want them to look neat, something like this: where they look in line. I do not know before hand how long

Re: formatting a list

2013-09-28 Thread Rob Dixon
On 28/09/2013 06:59, Rajeev Prasad wrote: hello, following is obtained by concatenating 3 values using an underscore to produce a list: |abc_12_4567 xy4z_xtr4_sdf PQRSDR_xcvf_scc234| i want them to look neat, something like this: where they look in line. I do not know before hand how long

Re: formatting a list

2013-09-28 Thread Shawn H Corey
On Fri, 27 Sep 2013 22:59:01 -0700 (PDT) Rajeev Prasad rp.ne...@yahoo.com wrote: i want them to look neat, something like this: where they look in line. I do not know before hand how long each word would be abc124567 xy4z___xtr4__sdf PQRSDR_xcvf__scc234 how could i use the

Re: Formatting Numbers

2012-02-12 Thread Shlomi Fish
Hi Mike, On Sun, 12 Feb 2012 10:14:42 -0600 Mike Blezien mick...@frontiernet.net wrote: Hello, Need a little assistance formatting numbers pulled from a databaes. Many are like this: 179550, 45960, 890458 etc. what I need to do is format these values with a comma so they look like

Re: Formatting Numbers

2012-02-12 Thread Rob Dixon
On 12/02/2012 16:14, Mike Blezien wrote: Need a little assistance formatting numbers pulled from a databaes. Many are like this: 179550, 45960, 890458 etc. what I need to do is format these values with a comma so they look like this: 179,550, 45,960, 890,458 What is the easiest way to do

Re: Formatting Numbers

2012-02-12 Thread Mike Blezien
: Mike Blezien Sent: Sunday, February 12, 2012 10:46 AM Subject: Re: Formatting Numbers On 12/02/2012 16:14, Mike Blezien wrote: Need a little assistance formatting numbers pulled from a databaes. Many are like this: 179550, 45960, 890458 etc. what I need to do is format

Re: Formatting Question

2008-09-16 Thread Mr. Shawn H. Corey
On Tue, 2008-09-16 at 17:32 -0700, [EMAIL PROTECTED] wrote: Hello I am sure the answer to this question is very simple. I have a number value which I am inserting into a string I am building. How can I append the number into the string so that it will always be 2 characters in length? In

Re: Formatting Question

2008-09-16 Thread Dermot
2008/9/17 [EMAIL PROTECTED]: Hello I am sure the answer to this question is very simple. I have a number value which I am inserting into a string I am building. How can I append the number into the string so that it will always be 2 characters in length? In other words if the month is 9,

Re: Formatting Question

2008-09-16 Thread John W. Krahn
[EMAIL PROTECTED] wrote: Hello Hello, I am sure the answer to this question is very simple. I have a number value which I am inserting into a string I am building. How can I append the number into the string so that it will always be 2 characters in length? In other words if the month is 9,

Re: Formatting output after search and replace

2008-04-29 Thread Chas. Owens
On Tue, Apr 29, 2008 at 6:06 PM, melody [EMAIL PROTECTED] wrote: snip #!/usr/bin/perl use warnings; use strict; snip Good, keep this up snip my @array; my @replacearray; snip Try to declare your variables where you initialize them. snip open FHR,'',repl.txt; open

Re: formatting tables generated by checkbox_group()

2007-11-27 Thread Sean Davis
On Nov 26, 2007 5:10 PM, neil [EMAIL PROTECTED] wrote: Hi, I was wondering if its possible to get the class= field passed to the tables generated by checkbox_group()? Not a direct answer to your question, but you will want to move away from using CGI to generate HTML and move toward using a

RE: formatting a string

2007-07-04 Thread Joseph L. Casale
Yup, lol... Wish I understood this! What is the line that does the search called? What do I look up to read up on this? Thanks! jlc From: Prabu Ayyappan [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 03, 2007 10:55 PM To: Joseph L. Casale; beginners@perl.org Subject: Re: formatting a string

RE: formatting a string

2007-07-04 Thread Prabu Ayyappan
. Casale; beginners@perl.org Subject: Re: formatting a string A quick solutionMay be you can enhance it more as you like.. @discarr = ('/vmfs/volumes/467f06a5-7d59c067-35cb-0007e9153886/AN-DC (Win2003 Ent x64)/AN-DC (Win2003 Ent x64).vmx','/vmfs/volumes/467f06a5-7d59c067-35cb

Re: formatting a string

2007-07-04 Thread Mumia W.
On 07/03/2007 08:32 PM, Joseph L. Casale wrote: I have an array with the following data in it: /vmfs/volumes/467f06a5-7d59c067-35cb-0007e9153886/AN-DC (Win2003 Ent x64)/AN-DC (Win2003 Ent x64).vmx /vmfs/volumes/467f06a5-7d59c067-35cb-0007e9153886/AN-DC (Win2003 Ent x64)/Disc 1.vmdk

Re: formatting a string

2007-07-03 Thread Tom Phoenix
On 7/3/07, Joseph L. Casale [EMAIL PROTECTED] wrote: I always deal with indices' 1 through to the end in the function in question, so it's easy to get the second indices (First disc) and so on. Huh? I need to manipulate the path though now, I am wanting to search for *all* the text

Re: formatting a string

2007-07-03 Thread Prabu Ayyappan
A quick solutionMay be you can enhance it more as you like.. @discarr = ('/vmfs/volumes/467f06a5-7d59c067-35cb-0007e9153886/AN-DC (Win2003 Ent x64)/AN-DC (Win2003 Ent x64).vmx','/vmfs/volumes/467f06a5-7d59c067-35cb-0007e9153886/AN-DC (Win2003 Ent x64)/Disc

Re: Formatting/presenting regex

2007-01-03 Thread Wiggins d'Anconia
Owen wrote: I have this regex to look at an Apache log. There are modules to help with that task on CPAN. m/^(\S+) \S+ \S+ \[(\d{2})\/(\S+)\/(\d{4}):.+\] (\w+) (\S+) ([^]+) (\d{3}) (\d+|-) .+$/; Would like to set it out in a bit more readable form a la Perl Cook Book and others eg m/

Re: Formatting/presenting regex

2007-01-03 Thread John W. Krahn
Owen wrote: I have this regex to look at an Apache log. m/^(\S+) \S+ \S+ \[(\d{2})\/(\S+)\/(\d{4}):.+\] (\w+) (\S+) ([^]+) (\d{3}) (\d+|-) .+$/; Would like to set it out in a bit more readable form a la Perl Cook Book and others eg m/ ^(\S+)# Comment \S+

Re: Formatting Question

2006-01-04 Thread Jeremy Vinding
[EMAIL PROTECTED] wrote: Hello, Here's my question. Let's say I have the following numbers and I want to print them out so they are formatted in money terms: examples: 10834.00 1939432.00 to print out as: $10,834.00 $1,939,432.00 How can I do this? I was suspecting that the

Re: Formatting Question

2006-01-04 Thread Tom Phoenix
On 1/4/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Let's say I have the following numbers and I want to print them out so they are formatted in money terms: Have you seen this sub? It's from p. 184 of the llama book (Learning Perl, 4th ed.). sub big_money { my $number = sprintf %.2f,

Re: formatting text

2005-11-29 Thread Jeff 'japhy' Pinyan
On Nov 29, Ing. Branislav Gerzo said: I'd like to know if there is module for following: Yes, Perl6::Form. It's a Perl 5 implementation of Perl 6's formats. 112 12345678901234567890 === OUT === | This is just | | small sentence | | about nothing. | === OUT === So,

Re: formatting text

2005-11-29 Thread Ing. Branislav Gerzo
Jeff 'japhy' Pinyan [JP], on Tuesday, November 29, 2005 at 09:12 (-0500 (EST)) thoughtfully wrote the following: I'd like to know if there is module for following: JP Yes, Perl6::Form. It's a Perl 5 implementation of Perl 6's formats. sometime is better ask, than DIY. Thanks a lot Japhy, this

Re: formatting text

2005-11-29 Thread Ing. Branislav Gerzo
Jeff 'japhy' Pinyan [JP], on Tuesday, November 29, 2005 at 09:12 (-0500 (EST)) wrote the following: Jeff, Perl6::Form is so powerful. But I can't find how to properly do this: I have values: ('Name','Branislav'); ('Surname','Gerzo'); And I'd like to print: |Name: Branislav

Re: formatting text

2005-11-29 Thread Brano Gerzo
Ing. Branislav Gerzo [IBG], on Tuesday, November 29, 2005 at 17:14 (+0100) wrote: IBG And I'd like to print: IBG |Name: Branislav | IBG |Surname.: Gerzo | IBG 26.^

Re: Formatting Variables

2005-10-12 Thread Wiggins d'Anconia
Ryan Frantz wrote: Perlers, Is there are way to format a variable before placing it into an array or hash? I have several variables that contain floating point numbers that I format prior to printing out: my $float = 12.3456; print %2.1f\n, $float; perldoc -f sprintf

RE: Formatting Variables

2005-10-12 Thread Ryan Frantz
-Original Message- From: Wiggins d'Anconia [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 12, 2005 5:31 PM To: Ryan Frantz Cc: Perl Beginners List Subject: Re: Formatting Variables Ryan Frantz wrote: Perlers, Is there are way to format a variable before placing

Re: Formatting Labels with CGI.pm

2005-03-26 Thread Bill Stephenson
On Mar 25, 2005, at 11:55 AM, Lawrence Statton wrote: The simplest solution is to temporarily turn off autoEscape Indeed it is. I'll try and remember this, again. On Mar 25, 2005, at 11:55 AM, Charles K. Clarkson wrote: I'm guessing that you have something like this somewhere. use CGI

Re: Formatting Labels with CGI.pm

2005-03-25 Thread Lawrence Statton
I'm trying to format the text used in my labels for a radio box group created with CGI.pm... Among other things, I've tried: I know there must be a way to do this and any help to get me over this hump would be much appreciated. The simplest solution is to temporarily turn off autoEscape

Re: formatting problem

2004-10-30 Thread Bob Showalter
Ing. Branislav Gerzo wrote: Hi all, I have little formatting problem, we have code: sub test { $sth = $dbh-prepare_cached(SQL); INSERT INTO table (ip, port, type, create_date) VALUES (?,?,?,?) SQL $sth-execute('12.12.12.12', 80, proxy, '2002-12-12'); $sth-finish; return; } this of

RE: formatting problem

2004-10-30 Thread Charles K. Clarkson
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: : Hi all, : : I have little formatting problem, we have code: : : sub test { : $sth = $dbh-prepare_cached(SQL); : INSERT INTO table (ip, port, type, create_date) : VALUES (?,?,?,?) : SQL : $sth-execute('12.12.12.12', 80, proxy, '2002-12-12');

Re: formatting the loop

2004-02-12 Thread Michael S. Robeson II
On Feb 11, 2004, at 2:55 PM, James Edward Gray II wrote: [snip] my @char = ( /[a-z]/ig, ( '-' ) x $len )[ 0 .. $len - 1 ]; If I may, yuck! This builds up a list of all the A-Za-z characters in the string, adds a boat load of extra - characters, trims the whole list to the length you want

Re: formatting the loop

2004-02-12 Thread James Edward Gray II
On Feb 12, 2004, at 10:06 AM, Michael S. Robeson II wrote: On Feb 11, 2004, at 2:55 PM, James Edward Gray II wrote: [snip] my @char = ( /[a-z]/ig, ( '-' ) x $len )[ 0 .. $len - 1 ]; If I may, yuck! This builds up a list of all the A-Za-z characters in the string, adds a boat load of

Re: formatting and syntax

2004-02-11 Thread James Edward Gray II
(redirected to Perl Beginners by James) On Feb 11, 2004, at 10:34 AM, Michael S. Robeson II wrote: Hey, thanks again for the perl code. You're welcome, but let's keep our discussion on the mailing list so we can all help and learn. However, I forgot to take into account that the original input

Re: formatting the loop

2004-02-11 Thread James Edward Gray II
On Feb 11, 2004, at 1:27 PM, Michael S. Robeson II wrote: [snip] Anyway, though it works great I am having a tough time trying to figure out WHY it works. See comments below, in the code. [snip] I think if I can understand the mechanics behind this script it will only help me my future

Re: formatting the loop

2004-02-11 Thread Rob Dixon
James Edward Gray II wrote: $/ = ''; # Set input operator Here's most of the magic. Exactly. If you don't believe in magic, don't write in Perl: most people don't. Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: formatting the loop

2004-02-11 Thread Michael S. Robeson II
See comments below. On Feb 11, 2004, at 2:55 PM, James Edward Gray II wrote: On Feb 11, 2004, at 1:27 PM, Michael S. Robeson II wrote: [snip] Anyway, though it works great I am having a tough time trying to figure out WHY it works. See comments below, in the code. [snip] I think if I can

Re: formatting the loop

2004-02-11 Thread James Edward Gray II
On Feb 11, 2004, at 2:35 PM, Michael S. Robeson II wrote: next unless s/^\s*(\S+)//; my $name = $1; Well, if we're reading name to name, the thing right a the beginning of our sequence is going to be a name, right? The above removes the name, and saves it for later use. OK, I think

Re: Formatting output

2004-02-10 Thread Jan Eden
Roger Grosswiler wrote: hi again, thanks to you, i got it with my date. so 1st point is out. i still have a short problem, as i should get my date back in the format ddmmyy and i get it in d m y (with %2d, but how to handle in vars) How about $lt2mday = sprintf(%02d, $lt2mday); perldoc -f

Re: formatting and syntax

2004-02-05 Thread R. Joseph Newton
Michael S. Robeson II wrote: Hi I am all still to new to PERL and I am having trouble playing with formatting my data into a new format. So here is my problem: I have data (DNA sequence) in a file that looks like this: # Infile bob AGTGATGCCGACG fred ACGCATATCGCAT jon

Re: formatting and syntax

2004-02-05 Thread Jeff 'japhy' Pinyan
On Feb 5, R. Joseph Newton said: my $sequence_length = 20; my $line = DATA; chomp $line; while ($line) { my $sequence_tag = trim_line($line); $line = DATA; chomp $line; my @nucleotides = split //, $line; push @nucleotides, '_' for (1..($sequence_length - @nucleotides)); I'd be in

Re: formatting and syntax

2004-02-04 Thread Rob Dixon
Michael S. Robeson II wrote: Hi I am all still to new to PERL and I am having trouble playing with formatting my data into a new format. So here is my problem: I have data (DNA sequence) in a file that looks like this: [snip] Please don't talk about interesting stuff like DNA sequences on a

Re: formatting and syntax

2004-02-04 Thread david
Michael S. Robeson II wrote: I have data (DNA sequence) in a file that looks like this: # Infile bob AGTGATGCCGACG fred ACGCATATCGCAT jon CAGTACGATTTATC and I need it converted to: # Outfile R 1 20 A G U G A T G C C G A C G - - - - - - - bob

Re: formatting and syntax

2004-02-04 Thread Jeff 'japhy' Pinyan
On Feb 4, Michael S. Robeson II said: bob AGTGATGCCGACG fred ACGCATATCGCAT jon CAGTACGATTTATC R 1 20 A G U G A T G C C G A C G - - - - - - - bob A C G C A U A U C G C A U - - - - - - - fred C A G U A C G A U U U A U C - - - - - - jon The R 1 is static and should

Re: Formatting the decimals

2004-01-29 Thread Owen Cook
On Thu, 29 Jan 2004, Mallik wrote: How do I format the decimals, i.e, if there is no decimal part, then add .00, if there is one decimal, then add '0'. For eg., how to convert 123 to 123.00 and 123.5 to 123.50. sprintf Try this -

Re: Formatting the decimals

2004-01-29 Thread John W. Krahn
Mallik wrote: Dear Friends, Hello, How do I format the decimals, i.e, if there is no decimal part, then add .00, if there is one decimal, then add '0'. For eg., how to convert 123 to 123.00 and 123.5 to 123.50. printf %.2f\n, $_ for 123, 123.5; John -- use Perl; program fulfillment

Re: Formatting the decimals

2004-01-29 Thread Adam
Owen is dead on, but I think we can do that with less code. Try something like: printf (%0.2f\n, $_) while (); Regards, Adam On Jan 29, 2004, at 5:25 AM, Owen Cook wrote: On Thu, 29 Jan 2004, Mallik wrote: How do I format the decimals, i.e, if there is no decimal part, then add .00, if there

RE: Formatting integer input: use the sprintf() in perlfunc - Perl builtin functions

2003-08-26 Thread Shaw, Matthew
whenever you need to do any special formatting like this, especially numbers, use the sprintf() in perlfunc - Perl builtin functions for your case, try this: print sprintf(%05.02f\n, 4.5 ); 04.50 Why not just use 'printf()' for this? Makes it somewhat less confusing while doing

RE: Formatting integer input: use the sprintf() in perlfunc - Perl builtin functions

2003-08-22 Thread Stuart Arnold
Sara, whenever you need to do any special formatting like this, especially numbers, use the sprintf() in perlfunc - Perl builtin functions for your case, try this: print sprintf(%05.02f\n, 4.5 ); 04.50 there are 2 other print formatters: report and here documents. I don't use the report method

Re: formatting a number

2003-07-04 Thread Janek Schleicher
Robert Citek wrote at Thu, 03 Jul 2003 18:48:02 -0500: I want to format a number so that it has commas as a separator. Here's the code I came up with: my $num=12345678; print scalar reverse( join(,, grep( /./ ,split (/(...)/,reverse($num), \n; This works but was wondering if anyone

Re: formatting a number

2003-07-04 Thread Jenda Krynicky
From: Robert Citek [EMAIL PROTECTED] Hello all, I want to format a number so that it has commas as a separator. Here's the code I came up with: my $num=12345678; print scalar reverse( join(,, grep( /./ ,split (/(...)/,reverse($num), \n; This works but was wondering if anyone

Re: formatting a number

2003-07-03 Thread Casey West
It was Thursday, July 03, 2003 when Robert Citek took the soap box, saying: : : Hello all, : : I want to format a number so that it has commas as a separator. Here's the : code I came up with: : : my $num=12345678; : print scalar reverse( join(,, grep( /./ ,split : (/(...)/,reverse($num),

Re: formatting money $12.00

2003-03-15 Thread Wiggins d'Anconia
David Gilden wrote: my (%bags_ordered,$bag); # is it ok to mix match the type of variables inside a # my vars declaration? Does Perl tell you it isn't? Only thing to watch out for here is combining list and scalar type variables during assignment. @bags = param('handbag'); #CGI.pm

Re: formatting money $12.00

2003-03-13 Thread David Gilden
#!/usr/bin/perl -w $num =1.12345; my $tax_formated = sprintf(%.2f, $num); # --- THIS LINE ### $tax_formated is used in a few places The important thing is, does it do what youo are expecting it to do? Well yes, I think so. I wanted to cut down on the times I was calling

RE: Formatting Variables.

2003-02-11 Thread Ken Lehman
Have you tried using printf? -Original Message- From: Ramón Chávez [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 11, 2003 9:07 AM To: [EMAIL PROTECTED] Subject: Formatting Variables. Hello boys and girls. Is there a way to give format to a Variable. I mean, if I don't want to get

RE: Formatting Variables.

2003-02-11 Thread wiggins
See also 'sprintf' if you don't want to print the value, but assign it: perldoc -f sprintf perldoc -f printf http://danconia.org On Tue, 11 Feb 2003 09:09:55 -0500, Ken Lehman [EMAIL PROTECTED] wrote: Have you tried using printf?

RE: Formatting Variables.

2003-02-11 Thread Ramón Chávez
Thank you everyone. sprintf is what I was looking for. -rm- - Original Message - From: [EMAIL PROTECTED] To: 'Ramón_Chávez' [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, February 11, 2003 8:30 AM Subject: RE: Formatting Variables. See also 'sprintf' if you don't want to print

RE: Formatting Variables.

2003-02-11 Thread Westgate, Jared
Ramón Chávez wrote: I mean, if I don't want to get printed 3.1415926535 (Or any irrational number) but something like 3.14, is there a way to use format?? I agree with the other posts. Use printf. Here is some more reading, to check out: perldoc -q long decimals perldoc -q round Hope this

Re: Formatting Variables.

2003-02-11 Thread Janek Schleicher
On Tue, 11 Feb 2003 08:06:33 -0600, Rgíón «hávkú wrote: Is there a way to give format to a Variable. perldoc -f printf I mean, if I don't want to get printed 3.1415926535 (Or any irrational number) but something like 3.14, is there a way to use format?? perl -e 'printf %1.2f, 3.1415926535'

RE: Formatting output

2002-12-26 Thread Jensen Kenneth B SrA AFPC/DPDMPQ
Wasn't really clear what I was trying to accomplish. Basically I am trying to iterate through 2 hashes at the same time so I can print 1 key / value pair from each hash on the same line. Repeating through each hash. Making things more complicated I am forced to use perl4 with no libraries, so I

RE: Formatting output

2002-12-26 Thread Bob Showalter
-Original Message- From: Jensen Kenneth B SrA AFPC/DPDMPQ [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 26, 2002 9:46 AM To: '[EMAIL PROTECTED]' Subject: Formatting output Accidentally sent before I was done writing. I am trying to iterate through two hashes and print

Re: Formatting output

2002-12-26 Thread R. Joseph Newton
Hi, I'm going to take this from here, rather than go on to the full code, because I think I see the core of the problem here. The foreach just isn't going to do it for what you want, although you maight call it on one of the hashes. You don't really indicate whether there is supposed to be

RE: formatting output

2002-12-12 Thread Mystik Gotan
And sprintf(), format(). -- Bob Erinkveld (Webmaster Insane Hosts) www.insane-hosts.net MSN: [EMAIL PROTECTED] From: Paul Kraus [EMAIL PROTECTED] To: 'Mariusz' [EMAIL PROTECTED], 'perl' [EMAIL PROTECTED] Subject: RE: formatting output Date: Thu, 12 Dec 2002 07:59:54 -0500

Re: formatting output

2002-12-11 Thread bansidhar
tab is \t and space is normal space *** REPLY SEPARATOR *** On 12/11/02 at 11:45 PM Mariusz wrote: I'm outputting lots of text into an email message. I would like to have some basic control over the way how it is presented, but the only command I know is \n - new line. What

Re: formatting output

2002-12-11 Thread Narayan Kumar
Hope this is what you need \r - return; \t - tab \f - form feed \b - backspace \a - bell \e - escape \007 - Any octal ASCII value ( here, 007 = bell ) \x7f - Any hex ASCII value ( here, 7f = delete ) .. ... From the Llama Book pg: 24 Narayan On Wed, 11 Dec 2002, Mariusz wrote:

Re: Formatting date, time

2002-08-13 Thread Tor Hildrum
[EMAIL PROTECTED] wrote: #Insert Date and Time my $month = $mon00 #Two digit month my $day = $mday00 #Two digit day in month my $year = $year#Two digit year ?? my $hour = $hour00 #Two digit: Hour my $min = $min00 #Two digit: Minutes #Combine date and time above into MMDDYYHHmm

Re: Formatting date, time

2002-08-13 Thread Robin Norwood
Gregg O'Donnell [EMAIL PROTECTED] writes: I'm looking for the simplest way to use the date and time in the format of MMDDYYHHmm (no spaces), which is used later in the program. Here's what I've come up with; comments or suggestions are appreciated. #Insert Date and Time my $month =

RE: Formatting date, time

2002-08-13 Thread Bob Showalter
-Original Message- From: Gregg O'Donnell [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 13, 2002 9:14 AM To: [EMAIL PROTECTED] Subject: Formatting date, time I'm looking for the simplest way to use the date and time in the format of MMDDYYHHmm (no spaces), which is used later

RE: Formatting date, time

2002-08-13 Thread Bob Showalter
-Original Message- From: Bob Showalter [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 13, 2002 9:33 AM To: 'Gregg O'Donnell'; [EMAIL PROTECTED] Subject: RE: Formatting date, time ... or, 2) Use the POSIX module's strftime(), which is simpler: use POSIX 'strftime'; my

Re: Formatting

2002-06-21 Thread Marco Antonio Valenzuela Escárcega
On Thu, 2002-06-20 at 22:42, Shishir K. Singh wrote: Hi, hi I need to format a string in a fixed width field. The string may be less than the length of the format, or may be greater. If less, then it should get padded with spaces (left or right justified , like using - in sprintf), if

Re: Formatting

2002-06-21 Thread John W. Krahn
Shishir K. Singh wrote: Hi, Hello, I need to format a string in a fixed width field. The string may be less than the length of the format, or may be greater. If less, then it should get padded with spaces (left or right justified , like using - in sprintf), if greater, then the string

RE: Formatting

2002-06-21 Thread Shishir K. Singh
Hi, Hello, I need to format a string in a fixed width field. The string may be less than the length of the format, or may be greater. If less, then it should get padded with spaces (left or right justified , like using - in sprintf), if greater, then the string should get truncated to

Re: Formatting

2002-06-21 Thread John W. Krahn
Shishir K. Singh wrote: Thanks to Mark, John, David and Timothy!! I get the results if I use the combination of eg $myVar = 'ABCDEFGHIJKLMNOP'; $newVar = pack('A10',$myVar); $newVar should have 'ABCDEFGHIJ'; # Works and faster than sprintf eg $myVar = 'ABCD'; $newVar =

RE: Formatting

2002-06-20 Thread David . Wagner
You can build the format string: my $myVar = 'ABCD'; #(Left Aligned, padded with spaces) #$newVar = sprintf(%-10s,$myVar); #$newVar should have 'ABCD '; # Works while ( 1 ) { printf Left or Right: ; chomp(my $MyInput = STDIN); last if ( $MyInput =~ /^ex/i ); my $MySign

RE: Formatting

2002-06-20 Thread Timothy Johnson
Try testing for the length of the string and then using the substr() function to get the part that you want for strings that are longer than desired. -Original Message- From: Shishir K. Singh To: [EMAIL PROTECTED] Sent: 6/20/02 10:42 PM Subject: Formatting Hi, I need to format a

Re: Formatting output

2002-06-13 Thread Ovid
I want to format the output of my database query. Current code while (@row =$sth-fetchrow() ) { print join(',',@row); } Results 1.38, .0396,.0076 Desired Results 1.38, 0.0396, 0.0076 Frank, It's tough for me to be sure exactly what you are wanting for formatting, so I would

Re: Formatting output

2002-06-13 Thread Jeff 'japhy' Pinyan
On Jun 13, Frank Newland said: Results 1.38, .0396,.0076 Desired Results 1.38, 0.0396, 0.0076 $row[0] = sprintf(%04d,$row[2]); ## results in == 0. $row[1] = sprintf(%0d.%04d,$row[4]); ## results in ==0. %d is for INTEGERS. You have floating points, so use %f. -- Jeff japhy

Re: Formatting output

2002-06-13 Thread John W. Krahn
Frank Newland wrote: I want to format the output of my database query. Current code while (@row =$sth-fetchrow() ) { print join(',',@row); } Results 1.38, .0396,.0076 Desired Results 1.38, 0.0396, 0.0076 $ perl -le'print join , , map { sprintf %.4f, $_ } ( 1.38, .0396, .0076

Re: Formatting in perl

2002-06-09 Thread drieux
On Friday, June 7, 2002, at 11:03 , Danial Magid wrote: [..] I am trying to put together a process that will format and print out checks (pay stbus), so I need to do a bit of formatting and combine the right fonts. I was wondering if there are any books or urls I could use for reference.

Re: Formatting in perl

2002-06-07 Thread David T-G
Danial -- ...and then Danial Magid said... % % Hi, Hello! % % I am trying to put together a process that will format and print out % checks (pay stbus), so I need to do a bit of formatting and combine the % right fonts. Who needs fonts? COURIER RUL3Z AND ASC11 IS DA B0MB, D00D! ;-) % %

Re: Formatting Output

2002-05-29 Thread Janek Schleicher
Melissa Cama wrote at Wed, 29 May 2002 03:13:46 +0200: ... I need to print out each value in the array (for each key) as a new line in an excel/CSV file. Also with each new line, a time stamp needs to be printed. ... foreach $str_feature (%hash_FeatureUsers){

RE: Formatting String output

2002-05-29 Thread Bob Showalter
-Original Message- From: Heiko Heggen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 29, 2002 5:48 AM To: [EMAIL PROTECTED] Subject: Formatting String output Hi Guys. I want to format my String output with the 'printf' command, but I cant find the solution. For you

Re: Formatting Output

2002-05-28 Thread John W. Krahn
Melissa Cama wrote: Hi, Hello, I currently have a hash which has one value as the key, and then an array of values assigned to this key. However the arrays are different lengths. I need to print out each value in the array (for each key) as a new line in an excel/CSV file. Also with

RE: formatting numbers

2002-04-29 Thread Timothy Johnson
I can't test these, but I think they will work. Play around with sprintf a little bit. Don't forget to check out 'perldoc -f sprintf'. 383.3as 383.30 $var = sprintf(%3.2f,$var) 37492908 as 37 492 908 if($var 1 =~ /(\d{2})(\d{3})(\d{3})/){ $formattedvar = $1 $2

Re: formatting numbers

2002-04-29 Thread John W. Krahn
Pat wrote: I have been through man printf, info printf and perldoc -f print and still can't find how to format numbers. In the program below I would like to print the numbers as below: 383.3as 383.30 $ perl -le'printf %.2f\n, 383.3' 383.30 37492908 as 37 492 908 If

Re: formatting database text

2002-02-05 Thread Chas Owens
On Tue, 2002-02-05 at 12:29, Hughes, Andrew wrote: I have created a news article database where non-technical people can cut and paste articles to be stored in a mySQL database table. Everything works. However when I display these in a browser, I want to have p class=whatever/p tags around

Re: formatting database text

2002-02-05 Thread Chas Owens
On Tue, 2002-02-05 at 12:29, Hughes, Andrew wrote: I have created a news article database where non-technical people can cut and paste articles to be stored in a mySQL database table. Everything works. However when I display these in a browser, I want to have p class=whatever/p tags around

Re: Formatting with printf

2002-01-10 Thread Scott
On Wed, 9 Jan 2002, John W. Krahn wrote: printf is based on the C language printf function and can be a bit tricky. The format %-5s will not truncate a value longer than 5 characters but it will pad a shorter value with spaces. To truncate a longer value use the format %-5.5s. Also, the

Re: Formatting with printf

2002-01-09 Thread Scott
Cancel the request. The field coming in actually had 10 spaces in it, so I just removed the spaces doing this: $field14 = @fields[14]; $field14 =~ s/ //g; print NEWQUOTES ($field14); On Wed, 9 Jan 2002, Scott wrote: printf NEWQUOTES (%-5s, @fields[14]); When I run the code I get 10 extra

RE: Formatting with printf

2002-01-09 Thread Bob Showalter
-Original Message- From: Scott [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 09, 2002 10:29 AM To: [EMAIL PROTECTED] Subject: Formatting with printf Hi all. I have a couple of strings that I need to format. One of those fields is a alpha/numeric string. Here is

Re: Formatting with printf

2002-01-09 Thread John W. Krahn
Scott wrote: Hi all. Hello, I have a couple of strings that I need to format. One of those fields is a alpha/numeric string. Here is the code: printf NEWQUOTES (%-5s, @fields[14]); When I run the code I get 10 extra spaces before the next field instead of the 5. The value of

RE: formatting text

2001-09-19 Thread Najamuddin, Junaid
Hi, # Define your fields my($fld1, $fld2, $fld3, $fld4, $fld5, $fld6, $fld7, $fld8); # load fields in array which are separated by pipe delimit foreach $val1(@arr1) # referring to values in array {($fld1, $fld2, $fld3, $fld4, $fld5, $fld6, $fld7, $fld8) = split(/\|/,$val1); # Print the

RE: Formatting text

2001-08-28 Thread Gibbs Tanton - tgibbs
If you are on a unix system...you can just say diff file1 file2. On Windows there is probably something comparable. -Original Message- From: Najamuddin, Junaid To: [EMAIL PROTECTED] Sent: 8/28/2001 9:18 AM Subject: Formatting text Hi, Here is my script, I am comparing two txt files

RE: Formatting text

2001-08-28 Thread Najamuddin, Junaid
Sorry I forgot about the platform It is on Windows NT platform thanks -Original Message- From: Gibbs Tanton - tgibbs [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 28, 2001 9:34 AM To: 'Najamuddin, Junaid '; '[EMAIL PROTECTED] ' Subject: RE: Formatting text If you are on a unix

RE: Formatting text

2001-08-28 Thread Mike Rapuano
] ' Subject: RE: Formatting text If you are on a unix system...you can just say diff file1 file2. On Windows there is probably something comparable. -Original Message- From: Najamuddin, Junaid To: [EMAIL PROTECTED] Sent: 8/28/2001 9:18 AM Subject: Formatting text Hi, Here is my script, I am

  1   2   >