I have 2 files one has the input and the other has data that will
replace specific string in file 1
eg
File 1
-
Text| to be replaced
Text| to be replaced
Text| to be replaced
Text| to be replaced
Text| to be replaced
File 2
-
replaced1
replaced2
replaced3
Output
--
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,'
I have 2 files one has the input and the other has data that will
replace specific string in file 1
eg
File 1
-
Text| to be replaced
Text| to be replaced
Text| to be replaced
Text| to be replaced
Text| to be replaced
File 2
-
replaced1
replaced2
replaced3
Output
--
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
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)
#!/usr/bin/perl
$t1=time();
$t2=$t1 - 604800;
$diff=$t1 - $t2;
print "Zeit 1; $t1\tZe
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
> -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.
>
>
t of files that were in the %PROD hash
but didn't find any file on in the %TARGET hash to match it (so it is not on
that server). The second column should be a list of files that were present
in %TARGET but not in %PROD ( files on the server but not in the
repository).
Thanks for the help / adv
Accidentally sent before I was done writing.
I am trying to iterate through two hashes and print each key/value. In one
column the key/value from one hash and another column the key/values of the
other hash. So the output would look something like this
Some header |header for column
I am trying to iterate through two hashes and print each key/value. In one
column the key/value from one hash and another column the key/values of the
other hash. So the output would look something like this
Some header |header for column 2
Key value key value
Key
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
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
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
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
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 about tab, spaces, etc..?
Mariusz
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
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
> 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
All,
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
Here's what I've tried.. but none of these formats appear
$row[0] = sprintf("%04d",$row[2]); ##
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){
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
Hi,
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 each new line, a time stamp needs t
22 matches
Mail list logo