Now I need to consider the last 2 records in the file(ignoring E) and merge them together (removing the decimal point) and total length would 12 characters each.
Each field would have total 6 characters after the decimal point is removed.
I want to check the argument in KSH. If the user type in the prompt 'find 3' it will format 3 to 003 to match the data in the text file. Same as with 10 to 010. Always begins with 0.
eg.
>find 3
Output:
003
>find 30
Output:
030 (7 Replies)
I would appreciate any help (sed / awk / perl) on the following question. I have the file in the following format. Note that the records are separated by the line that starts with the word "TRACE".I want the 5th and 6th values on the line starting with "TRACE" to be repeated down the file until the... (3 Replies)
Hi Friends,
I need to write a script which reads the file and prints them horizontally.
For example,
the file contains something like
x1
x2
x3
x4
x5
my script reads this file as "for i in `cat filename`", but I need an output something like
"config file = x1.ccfg,... (3 Replies)
I would like to search between two a string. I thought this would be easy. The is always at the beginning of a line.
The code:
gawk '/^/{d=$1},/searchstring/,/^(d+1)/'
or
gawk '/^/,/searchstring/,/^/'
did not return the desired result.
inputfile.txt
999 some text searchstring some... (6 Replies)
I would like to print string between two sequent digits and concatenate it into one single line.
input.txt
99 cord, rope, strand, twine,
twist, 100 strand, twine, twist,
cord, rope 101 strand, twine,
twist, twine, twist, cord, rope
105 cord, rope ,twi ... (8 Replies)
Hello all! I've looked all over the internet and this site and have come up a loss with an easy way to make a bash script to do what I want to do. I have a file with a naming convention as follows:
2012-01-18 string of words here 123.jpg
2012-01-18 string of words here 1234.jpg
2012-01-18... (2 Replies)
i have a o/p from find command that needs to be formatted
currently when i'm running
find . -name "v.info"
it is giving below o/p
/o/a/b/c/v.info
/o/a/b/c/d/v.info
/o/aa/bb/cc/v.info
/o/aa/bb/cc/dd/v.info
my requirement is if v.info is coming under sub-directories it shul be... (15 Replies)
Hello;
I am not good at file and stream editing. I need to replace a few digits in two files. The lines in files looks like this:
Line in the first file, /dw300/data/obe/2019273.L800JR.1909.273
Line in second file, 1|2019273.L800JR.1909.273
I will write a function to connect to... (7 Replies)
Hi All ,
I am having an input file as stated below
5728 U_TOP_LOGIC/U_CM0P/core/u_cortexm0plus/u_top/u_sys/u_core/r03_q_reg_20_/Q 011
611 U_TOP_LOGIC/U_CM0P/core/u_cortexm0plus/u_top/u_sys/u_core/r04_q_reg_20_/Q 011
3486... (4 Replies)
Discussion started by: kshitij
4 Replies
LEARN ABOUT MOJAVE
log::message::simple
Log::Message::Simple(3pm) Perl Programmers Reference Guide Log::Message::Simple(3pm)NAME
Log::Message::Simple - Simplified interface to Log::Message
SYNOPSIS
use Log::Message::Simple qw[msg error debug
carp croak cluck confess];
use Log::Message::Simple qw[:STD :CARP];
### standard reporting functionality
msg( "Connecting to database", $verbose );
error( "Database connection failed: $@", $verbose );
debug( "Connection arguments were: $args", $debug );
### standard carp functionality
carp( "Wrong arguments passed: @_" );
croak( "Fatal: wrong arguments passed: @_" );
cluck( "Wrong arguments passed -- including stacktrace: @_" );
confess("Fatal: wrong arguments passed -- including stacktrace: @_" );
### retrieve individual message
my @stack = Log::Message::Simple->stack;
my @stack = Log::Message::Simple->flush;
### retrieve the entire stack in printable form
my $msgs = Log::Message::Simple->stack_as_string;
my $trace = Log::Message::Simple->stack_as_string(1);
### redirect output
local $Log::Message::Simple::MSG_FH = *STDERR;
local $Log::Message::Simple::ERROR_FH = *STDERR;
local $Log::Message::Simple::DEBUG_FH = *STDERR;
### force a stacktrace on error
local $Log::Message::Simple::STACKTRACE_ON_ERROR = 1
DESCRIPTION
This module provides standardized logging facilities using the "Log::Message" module.
FUNCTIONS
msg("message string" [,VERBOSE])
Records a message on the stack, and prints it to "STDOUT" (or actually $MSG_FH, see the "GLOBAL VARIABLES" section below), if the "VERBOSE"
option is true. The "VERBOSE" option defaults to false.
Exported by default, or using the ":STD" tag.
debug("message string" [,VERBOSE])
Records a debug message on the stack, and prints it to "STDOUT" (or actually $DEBUG_FH, see the "GLOBAL VARIABLES" section below), if the
"VERBOSE" option is true. The "VERBOSE" option defaults to false.
Exported by default, or using the ":STD" tag.
error("error string" [,VERBOSE])
Records an error on the stack, and prints it to "STDERR" (or actually $ERROR_FH, see the "GLOBAL VARIABLES" sections below), if the
"VERBOSE" option is true. The "VERBOSE" options defaults to true.
Exported by default, or using the ":STD" tag.
carp();
Provides functionality equal to "Carp::carp()" while still logging to the stack.
Exported by using the ":CARP" tag.
croak();
Provides functionality equal to "Carp::croak()" while still logging to the stack.
Exported by using the ":CARP" tag.
confess();
Provides functionality equal to "Carp::confess()" while still logging to the stack.
Exported by using the ":CARP" tag.
cluck();
Provides functionality equal to "Carp::cluck()" while still logging to the stack.
Exported by using the ":CARP" tag.
CLASS METHODS
Log::Message::Simple->stack()
Retrieves all the items on the stack. Since "Log::Message::Simple" is implemented using "Log::Message", consult its manpage for the
function "retrieve" to see what is returned and how to use the items.
Log::Message::Simple->stack_as_string([TRACE])
Returns the whole stack as a printable string. If the "TRACE" option is true all items are returned with "Carp::longmess" output, rather
than just the message. "TRACE" defaults to false.
Log::Message::Simple->flush()
Removes all the items from the stack and returns them. Since "Log::Message::Simple" is implemented using "Log::Message", consult its
manpage for the function "retrieve" to see what is returned and how to use the items.
GLOBAL VARIABLES
$ERROR_FH
This is the filehandle all the messages sent to "error()" are being printed. This defaults to *STDERR.
$MSG_FH
This is the filehandle all the messages sent to "msg()" are being printed. This default to *STDOUT.
$DEBUG_FH
This is the filehandle all the messages sent to "debug()" are being printed. This default to *STDOUT.
$STACKTRACE_ON_ERROR
If this option is set to "true", every call to "error()" will generate a stacktrace using "Carp::shortmess()". Defaults to "false"
perl v5.18.2 2014-01-06 Log::Message::Simple(3pm)