hi,
I want to check the status of File handle before
reading/writing to file ? How to do this ?
like following
open(FH_IN_FILE, ">file.txt");
# This statement is executed by some other function
close(FH_IN_FILE);
print FH_IN_FILE "SOME DATA";
here before writing to file, i want to check
return 0;
}
here i am closing previously opened file...
if i want to open a file in write mode, we have to
specify ">$file" right ?
does >$file will work ?
I will drop if m/...
Thanks
-Madhu
--- James Edward Gray II <[EMAIL PROTECTED]>
wrote:
> On May 5, 2004, at 12:
--- James Edward Gray II <[EMAIL PROTECTED]>
wrote:
> On May 5, 2004, at 11:03 AM, Madhu Reddy wrote:
>
> > -replace.pl---
> > #!/bin/perl -w
> >
> > # INPUT STRING
> > my $in_str = ".import ";
> >
>
-replace.pl---
#!/bin/perl -w
# INPUT STRING
my $in_str = ".import ";
# REPLACE STRING
my $repl = "/home/madhu/apps/toll.txt";
$_=$in_str;
# I don't want to use following, because
# "TOLL_FREE" will be changed each time
#s//$repl/;
# FOLLOWING WILL NOT WORK
#s/_IFILE>
uot; is fixed and common for all..
How to replace this ?
--- James Edward Gray II <[EMAIL PROTECTED]>
wrote:
> On May 4, 2004, at 10:54 AM, Madhu Reddy wrote:
>
> > Hi,
> >in a file, I have following variables,
> >
> >
> >
> >
> >
Hi,
in a file, I have following variables,
I want to replace those variables with
values
basically i want to replace all <*_IFILE> with some
value say file.txt
How to do this in perl ?
Thanks
__
Do you Yahoo!?
Win a $2
Hi,
I need some help on regular expression...
i have following in variable $total_count
$total_count = "##I USBP 01 10:38:09(000)
ETRACK_TOTAL_RECS : 100"
Here in this ETRACK_TOTAL_RECS is fixed and common for
all and rest is changing...
like following
$total_count = "##I USBP 02 12
Hi,
How to create data structures in perl ?
I have following data structure in C...and i have to
create similar data structure in perl and use...
how to create data strutures in perl and how to use ?
typedef struct { charPrefix[8];
charPrint;
Hi,
I want to write following C Equivalant with PERL
My perl equvalant is at the end of this mail..
please correct me...
my questios are inside perl comments...
--
C Code start
-
for(i=0;i<(int)strlen(Buffer);i++)
{
if((Buffer[i] < 32) || (Buffer[i] > 126))
{
if((Buffer[i]
--- Madhu Reddy <[EMAIL PROTECTED]> wrote:
> Date: Mon, 7 Jul 2003 10:39:51 -0700 (PDT)
> From: Madhu Reddy <[EMAIL PROTECTED]>
> Subject: ASCII Manipulation in perl
> To: [EMAIL PROTECTED]
>
> Hi,
> I want to write following C Equivalant with PERL
> My
I didn't get this mail...
I am re seinding
Hi,
I want to write following C Equivalant with PERL
My perl equvalant is at the end of this mail..
please correct me...
my questios are inside perl comments...
--
C Code start
-
for(i=0;i<(int)strlen(Buffer);i++)
{
if((Buffer[i] <
Hi,
I have file to load into database...
the file contains fixed length records..
basically i need to check for record lengths before
loading into database..
suppose my fixed record length is 25
i have to read each record
then of recors length is more than 25, delete the
chars after 25...basi
quotes, not backticks.
> Backticks are a special quote-like operator that
> runs the command in as if
> it was run on the command-line and then passes the
> results back. So you
> would use backticks like this:
>
> my $result = `command`;
>
> -Original Message
the old STDERR in so that you
> can put it back later, but
> this shouldn't be necessary in Windows.
>
> -Original Message-
> From: Madhu Reddy [mailto:[EMAIL PROTECTED]
> Sent: Monday, June 30, 2003 8:54 AM
> To: [EMAIL PROTECTED]
> Subject: PERL HANG on WINDOW
Hi,
When i run perl programs, some times it will hang in
the middle of program...and when i press
then it is going to next step..
But it will not happen all the times...
once some times it is hapenning
i don't know what could be the reasons...
my plat form is Windows 2000 and i am using
This will do ...
alpha_hash is u r hash...
-
my %alpha_hash = ();
open(FH_D,"$d_list") || die "File opening $d_list\n";
@file_list = ;
foreach $record (@file_list) {
@t_array = split(/\|/, $record);
$alpha_hash{$t_array[0]} = $t_array[1];
}
close(FH_D);
--- Tim
This will do ...
alpha_hash is u r hash...
-
my %alpha_hash = ();
open(FH_D,"$d_list") || die "File opening $d_list\n";
@file_list = ;
foreach $record (@file_list) {
@t_array = split(/\|/, $record);
$alpha_hash{$t_array[0]} = $t_array[1];
}
close(FH_D);
--- Tim
Hi,
I want to find and replace string with particular
pattern
my $str = " 13 A.MFDF_FEEDER_ET";
$str =~ s/\s+//g;
here i want to replace string that end with "_ET" with
null
basically i wanto get result 13 in $str.
how to do this?
I really appreciate u r help
Thanks
Hi,
Is there any polling mechanism in perl ?
Following is my problem..
my program has to wait (poll) on particular
folder...
If any file arrived on that folder, my main program
has to invoke another program...
In Unix, we have poll() system call for waiting on
particular event ?
is there any s
Hi,
I want to pass command line arguements to perl
program ?
How to do this ?
Thanks
-Madhu
__
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For ad
Does anybody know, is there any lsof, unix equivalant
utility in perl (on windows)
Thanks in advance
-Madhu
__
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com
--
To unsubscribe, e-mail: [EMAIL PRO
> >> i don't thing the above will work. try:
> >>
> >> for(split(//)){
> >> if(ord < 32 || ord > 126){
> >> print "Char is non printable char\n";
> >> }else{
> >> print "$_\n";
> >> }
> >> }
I want to do following, if any char is ASCII value of
10 or 13, i want to make that char as null
like fo
Hi,
I want to check for some ASCII chars in perl like
following "C" code..
How to do this in Perl ?
follwing will work in perl ?
for($i=0;$i < length;$i++) {
if (($_[$i] < 32) || (($_[$i] > 126)) {
print "Char is non printable char\n";
}
}
following is C code
for(i=0;i<(int)strlen(Buffer);
Hi,
I want to find out how to pass perl variables
between files and functions...
in C, we declare with "extern" to work in different
files how to do in perl...
between files means , i declare variable in file1 and
file2 will update those variables and want to access
in file1
Ex: like $var1 a
> > -
>
> if you do perl -V, do you see a line that looks
> like:
>
> usethreads=define use5005threads=undef
> useithreads=define
> usemultiplicity=define
>
>
NO, I didn't see that one...
following is my perl -v output
how to debug that error.. i started my script with
debug option..
sti
, Larry Wall
Binary build 805 provided by ActiveState Corp.
http://www.ActiveState.com
Built 18:08:02 Feb 4 2003
-
--- david <[EMAIL PROTECTED]> wrote:
> Madhu Reddy wrote:
>
> > Hi,
> > I have following sorting program...
> > basically it will split the large
Hi,
I have following sorting program...
basically it will split the large files into small
file and creates thread..each thread will sort files
after that merge back all sorted files...
this program works fine on single CPU machine...
same program giving problem on 8 CPU machine...
the problem
0x2808335c" referenced memory at
"0x0004". The memory couldn't be written
this error is because of not doing lock
on %bounds ?
when we do the lock like
lock(%bounds)
does it lock all the elements in hash ?
Thanx
Madhu
Thanx
-Madhu
--- david <[EMAIL PROTE
hi,
I just want to find out how and when to use locks in
threads...
i have following program..
in following %bounds is global variable
each thread will update %bounds
and later i am using %bounds...
do i have lock the %bounds before each thread update ?
my %bounds = ();
for(@tmp_file
Hi,
does anybody have sample perl script multi
threaded program
any site does talks about perl multi threading
I appreciate u r help
Thanx
-Madhu
__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/
t; . $counter++ .
".txt";
.
}
following are the statistics...
it took 5:30 hours to sort 13 millions record file...
on 8 CPU's and 8GB RAM
how to improve the speed
i think 5 hours is more
Thanx
-Madhu
--- david <[EMAIL PROTECTED]> wrote:
> Madhu Reddy wrote:
>
that is true..before loading into database...we need
to do some validations
if input file contains morethan 5% duplicates,
don't load into databse...
that is why i am finding duplicates...
Thanx
-Madhu
--- "Beau E. Cox" <[EMAIL PROTECTED]> wrote:
> Thanks Peter - good point
>
> > -Origi
$_;
$good++;
}
last_$_ = $_;
}
then only thing is we need to find out how much time
it will take to sort 22 millino rows file
Any comments ? sugegestions ?
--- "Beau E. Cox" <[EMAIL PROTECTED]> wrote:
> Hi -
>
> > -Original Message-
&
Hi,
I have a script that will find out duplicate rows
in a file...in a file i have 13 millions of
records
out of that not morethan 5% are duplicate
for finding duplicate i am using following function...
while () {
if (find_duplicates ()) {
$dup++
}
}
# return 1, if
Hi,
How to get first line, last line and no of lines in
a file.
is there any perl functions available for that ?
right now what i am doing is
open file
while (
{
$lines++;
}
close(FH)
This operation is expensive..
suppose, if file have millions of records,
it will take more time
I t
Hi Guys,
now it's working fine
there is typeo in e-mail address
i put email address as '[EMAIL PROTECTED]'
here typeo...
actual is "redy.ponnolu"
now, how to chatch this type of erros in script...
if i put wrong e-mail address...does it bounce back ?
how to
Hi,
This is regarding sending e-mail from perl script
using SMTP
my script is running fine..but i am not getting any
mail which i sent from script...
following is my program
correct me if any thing is wrong in the script.
messages with debug option attached at the end.
-
Hi,
i have a script with multi files...
in one file, i defined all the functions..
and from other file i am calling the functions...
suppose, following is my function defination...
sub log_msg()
{
print LOG "@_\n";
}
i am calling this function with
log_msg("Running script\n")
here i
Hi,
I have following script, basically this will
ding the duplicate rows in a file...
I am getting following warnings
Use of uninitialized value at Audit_WTN.pl line 133,
chunk 18.
Use of uninitialized value at Audit_WTN.pl line 133,
chunk 19.
how to avoid warning at following location
13
Hi,
I want to put MFILE=mdl_data.txt in ENV and want to
access later..
i am trying following...I am getting error...
system(`MFILE=mdl_data.txt`);
$k6 = "MFILE";
$key6 = $ENV{$k6};
print "$key6 \n";
how to do this ?
Thanx
-Madhu
__
Do you Yah
> >
> > while() {
> >if (length($_) == 263) {
> > Add 2 spaces to the end (before new line
> char)
> > of $_
>
> $_ .= ' ';
> # or
> $_ .= ' ' x 2;
>
>
> >}
> > }
> >
> > How to do this ?
$_ will have newline char..
' '(2 spaces) added after the new
Hi,
I want to do some data validation...
I hvae to read each (row)line in a file and have to
check the length of each row, if length of row is 263
I need to add 2 spaces at the end of line (row) to
make 265 row lenghth ..
Here how to add spaces at the end of length
while() {
if (length($_)
Hi,
I want to sort a file and want to write the result
to same file
I want to sort a based on 3rd column..
following is my file format
C1 C2 C3 C4
1234 guhr 89890 uierfer
1324 guii 60977 hiofver
5467 frwf 56576 err
i want to sort above file based on column 3(C3)
and i want t
>
> 1 word. Oracle.
>
> This is really why database software exists. I know
> this probably
> didn't help much, but if this is more than a one
> time occurrence a real
> database ought to be considered.
>
> You might start by checking out any reference
> material on how large
> database syst
C1 C2 C3 C4
12345 efghij klmno pqrs
34567 abnerv oiuuy uyrv
94567 abnerv gtuuy hyrv
12345 aswrfr rtyyt erer
94567 abnerv gtuuy hyrv
Here row1 and row4 are duplicates...those needs
to be removed or moved to another file
--- Madhu Reddy <[EM
Hi,
I want find a duplicate records in a large file
it contains around 22 millions records.
basically following is my file structure
C1 C2 C3 C4
12345 efghij klmno pqrs
34567 abnerv oiuuy uyrv
...
...
...
...
) ?
Thanx
-Madhu
--- david <[EMAIL PROTECTED]> wrote:
> Madhu Reddy wrote:
>
> > Hi,
> >When i ran perl script on multi processor
> > machine...
> > it is taking more time as than on single processor
> > machine
> >
> > Let me explai
Hi,
When i ran perl script on multi processor
machine...
it is taking more time as than on single processor
machine
Let me explain clearly
I have big file (.5Gb) it has 8 million records...
my perl script will read each record and validates..
Validation includes..checking each record l
Hi,
We are doing file operations on large files(more
than 5GB).
basically reading the file and validatiing the each
record in in the file.
we used Tie::File
It took 35 min to read and count the number of lines
in file of 8millions (500MB)
following is the script
Does anybody have a
This script is running where my e-mail client is
(MicroSoft Look)...
I am not running on remote..
I am running on localNetwork
I am using Microsoft Outlook 2002
I used following procedure to get the my-email server
name
-
1. On Outlook "Tools>options>Mail
Setup===>E-mail Accoun
at
> the command prompt. If
> you get a connection refused or denied message, then
> you will not be able to
> send the email from your script.
>
> -Original Message-
> From: Madhu Reddy [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 05, 2003 6:11 PM
> To: [EM
I changed to Net::SMTP
still i am getting following error
Couldnt make Connection: Unknown error
--- david <[EMAIL PROTECTED]> wrote:
> Madhu Reddy wrote:
>
> > use NET::SMTP ;
>
> should probably be:
>
> use Net::SMTP;
>
> unless N
Hi,
I want to send an e-mail from perl script
i have following script...but i am getting following
error.
does anybody have any idea, why it is failing ?
==
following is error message
--
Couldnt make Connection: Unknown error
---
following is script
===
53 matches
Mail list logo