abcd
adding
more
and then
wow is that working
abcd
last line
The file content is abcd
The file content is adding
The file content is more
The file content is and then
The file content is wow is that working
The file content is abcd
You could apparently see that the last line from the file 's' is missing
HI
I need to read each line (test.txt) and store it in a array (@test)
How to do it in perl.
Suppose i have a file test.txt. I have to read each line of the test.txt file and store it in a array @test. How to do it in perl.
Regards
Harikrishna (3 Replies)
So, I want to read line-by-line a text file with unknown number of files....
So:
a=1
b=1
while ; do
b=`sed -n '$ap' test`
a=`expr $a + 1`
$here do something with b etc
done
the problem is that sed does not seem to recognise the $a, even when trying
sed -n ' $a p'
So, I cannot read... (3 Replies)
Hi All
I have the following code
sub pall_nvrm {
my $cmd = `pall -w "/u/ab/scripts/dev/nvrmerros/nvrmpaller"`;
print $cmd;
}
if i run
pall -w "/u/ab/scripts/dev/nvrmerros/nvrmpaller"
in a shell i get this sort of out put
eagley:
boxted:
cadle:
eabost:
hales: (3 Replies)
So, the beginning of my script will cat & grep a file with the output directed to a new file. The data I have in this file needs to be parsed, read and evaluated.
Basically, I need to identify the latest date/time stamp and then calculate whether or not it is within 15 minutes of the current... (1 Reply)
Hello Everyone,
I have written a perl script that will load the entire data file into an array and then I would check the value of the specific column and then if interested I will write to a good file else I will write it to a bad file.
But here, the problem is that if the data file is a... (15 Replies)
I need some help. I would like to read in a text file.
Take a variable such as ROW-D-01, compare it to what's in one line in the text file such as PROD/VM/ROW-D-01 and only input PROD/VM into a variable without the /ROW-D-01.
Is this possible? any help is appreciated. (2 Replies)
Hi,
i have a scenario were i should compare a few fields from each line then increment a variable based on that.
Example file
989878|8999|Y|0|Y|N|V
989878|8999|Y|0|N|N|V
989878|8999|Y|2344|Y|N|V
i have 3 conditions to check and increment a variable on every line
condition 1 if ( $3... (4 Replies)
Hi,
I want to read a live log file line by line and considering those line which start from time stamp;
Below code I am using, which read line but throws an exception when comparing line that does not contain error code
tail -F /logs/COMMON-ERROR.log | while read myline; do... (2 Replies)
Hi All,
i want to write a shell script read below file line by line and want to exclude the lines which contains empty value for MOUNTPOINT field.
i am using centos 7 Operating system.
want to read below file.
# cat /tmp/d5
NAME="/dev/sda" TYPE="disk" SIZE="60G" OWNER="root"... (4 Replies)
Discussion started by: balu1234
4 Replies
LEARN ABOUT DEBIAN
log::report::die
Log::Report::Die(3pm) User Contributed Perl Documentation Log::Report::Die(3pm)NAME
Log::Report::Die - compatibility routines with Perl's die/croak/confess
INHERITANCE
Log::Report::Die
is a Exporter
Functions
die_decode(STRING)
The STRING is the content of $@ after an eval() caught a die(). croak(), or confess(). This routine tries to convert this into
parameters for Log::Report::report(). This is done in a very smart way, even trying to find the stringifications of $!.
Return are four elements: the error string which is used to trigger a "Log::Report" compatible "die()", and the options, reason, and
text message. The options is a HASH which, amongst other things, may contain a stack trace and location.
Translated components will have exception classes "perl", and "die" or "confess". On the moment, the "croak" cannot be distiguished
from the "confess" (when used in package main) or "die" (otherwise).
The returned reason depends on whether the translation of the current $! is found in the STRING, and the presence of a stack trace.
The following table is used:
errstr stack => reason
no no ERROR (die) application internal problem
yes no FAULT (die) external problem, think open()
no yes PANIC (confess) implementation error
yes yes ALERT (confess) external problem, caught
= @{$opt{stack}} ? ($opt{errno} ? 'ALERT' : 'PANIC')
: ($opt{errno} ? 'FAULT' : 'ERROR');
SEE ALSO
This module is part of Log-Report distribution version 0.94, built on August 23, 2011. Website: http://perl.overmeer.net/log-report/
LICENSE
Copyrights 2007-2011 by Mark Overmeer. For other contributors see ChangeLog.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See
http://www.perl.com/perl/misc/Artistic.html
perl v5.14.2 2011-08-23 Log::Report::Die(3pm)