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 OUT,'

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); perldo

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 an

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 a

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 can

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 PROTEC

RE: formatting output

2002-12-12 Thread Paul Kraus
Also look up function printf. > -Original Message- > From: Mariusz [mailto:[EMAIL PROTECTED]] > Sent: Thursday, December 12, 2002 12:46 AM > To: perl > Subject: formatting output > > > I'm outputting lots of text into an email message. I would > like to have some basic control over the

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 w

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. Wha

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

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. -- Jef

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

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 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. Al