- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Update a word in a line
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-16-2009 07:15 AM
тАО06-16-2009 07:15 AM
Re: Update a word in a line
> Can you tell me what was wrong in the first code?
As I said, you never wrote to anything other than STDOUT. Remember you can 'select()' a default filehandle or explicitly use one but you did neither. The '/e' modifier in your regex whould have been '/g'. You were attempting to evaluate and execute while substituting and there was nothing legal in what you wrote.
> And secondly the number of files will be huge,maybe like 3-4lakhs.So will @ARGV have any issue?
No, this should not be an issue.
By the way, what does "lakhs" stand for? You have used that term before.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-16-2009 07:27 AM
тАО06-16-2009 07:27 AM
Re: Update a word in a line
1 lakh = 100,000
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-16-2009 07:35 AM
тАО06-16-2009 07:35 AM
Re: Update a word in a line
You didn't remember when I asked that question? :-)
Basically the OP should stick with SI units or actual numbers or scientific notation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-16-2009 07:55 AM
тАО06-16-2009 07:55 AM
Re: Update a word in a line
It worked after these changes, can you tell me if these are correct?
foreach $event (@files) {
my $backup=$event.".bak";
open(MYFILE,"<$backup")|| die "cant find it";;
open(MYFILE1,"<$event")|| die "cant find it";;
while (
if (/^not/) {
($line=$_) =~ s/OCAL/OWN/e;
print MYFILE $line;
}
else { print MYFILE $_; }
}
close(MYFILE);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-16-2009 08:00 AM
тАО06-16-2009 08:00 AM
Re: Update a word in a line
>Dennis: Basically the OP should stick with SI units or actual numbers or scientific notation.
Funny, really funny.I think neither of you have read the memo, perttaining to renaming the ITRC.
...
From now on, the website formerly known as Information Technology Response Center, a.k.a., ITRC, will be renamed as
Indian Tech Rescue Center
We are hoping that, keeping the same abbreviation, will help you adapt the change faster and better.
...
A simple wikipedia search would show you the meaning of word lakh being a hundred thousand. If you have noticed the majority of the names floating around ITRC nowadays, it is expected by the original poster of the question that everyone should understand the Indian terminology, despite how prudish t expectation sounds.
Viva globalism !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-16-2009 08:13 AM
тАО06-16-2009 08:13 AM
Re: Update a word in a line
> It worked after these changes, can you tell me if these are correct?
Yes, I know it worked --- I tested it too.
Your suggestion will _not_ work. You didn't read what I said about the '\e' modifier. You open both files for input.
If you would get in the habit of using the 'strict' and 'warnings' pragmas you will catch many stupid errors the first time you attempt to run your script:
use strict;
use warnings;
Add these and make the necessary changes.
By the way, thanks Dennis & Patrol. I should have known Dennis that you would have asked that too :-) --- You and I do think alike.
Regards!
...JRF...
- « Previous
-
- 1
- 2
- Next »