I have a file say "SAMPLE.txt" with following content,
I want a output file say "RESULT.txt" as,
I need to first fetch content between P1 & P2 part then I want to find value of 10,9*/ which I want to save to another value. Incase some P1--P2 block doesn't contain this value I want to save it as "NULL".
Hi
I need to append the following block of statements in the middle of the file:
#
openpipe tsdbdwn2
set -x
exec >> /tmp/tsdbdwn2.fifo 2>&1
#
This needs to be appended right after another block of statements:
if test $# -eq 0 ;then
echo "Safety check - do you really wish to run" $0 "... (5 Replies)
(1) Yes but how is this block different from the other 24? You will need this information in order to identify and replace this block correctly (out of the 25).
Ans: The 1st line and last line of this block are unique from other block.
The 1st line is “rem Subset Rows (&&tempName.*) and
The... (1 Reply)
Hi there, If I run "ipmitool bmc info" on any of my x86 boxes, i get
Device ID : 32
Device Revision : 1
Firmware Revision : 1.1
IPMI Version : 2.0
Manufacturer ID : 42
Manufacturer Name : Sun Microsystems
Product ID ... (7 Replies)
I was reading a book on UNIX internals "The design of the UNIX Operating system." There are two memory structures that are confusing me:
1) Buffer cache
2) Inode cache
My questions are
1) Does a process get both buffer cache and Indoe cache allocated when it opens/creates a file?
2) if no,... (1 Reply)
Hei buddies,
Need ur help once again.
I have a file which has bunch of lines which starts from a fixed pattern and ends with another fixed pattern.
I want to make use of these fixed starting and ending patterns to select the bunch, one at a time.
The input file is as follows.
Hi welcome... (12 Replies)
I have a "main" file which has blocks of data for each user defined by tags BEGIN and END.
BEGIN
ID_NUM:24879
USER:abc123
HOW:47M
CMD1:xyz1
CMD2:arp2
STATE:active
PROCESS:id60
END
BEGIN
ID_NUM:24880
USER:def123
HOW:4M
CMD1:xyz1
CMD2:xyz2
STATE:running
PROCESS:id64
END (7 Replies)
I want to process a file block by block using sed, and if that block does not contain two patterns, then that complete block has to be printed.
See below for the example data.
................................server 1...............................
running process 1
running... (8 Replies)
please consider the following file, there are repeated blocks of m values, and nested s values within. there are 2 columns (cols 3 and 4)associated with each m,s combination. All s1 rows must get a value of a(col 3 in output), all s2 values must get a value of b(col 3 in output). If s1 and s2 rows... (1 Reply)
I need to search for a block with the starting pattern say
"tabId": "table_1", and ending pattern say "]"
and then add a few lines before "]"
"block1":"block_111"
"tabId": "table_1",
"title":"My title"
.....
....
}]
how do I achieve it using awk and sed.
Thanks,
Lakshmi (3 Replies)
Hi,
Could you please help me finding a way to replace a specific value in a text block when matching a key pattern ?
I got the keys and the values from a command similar to:
echo -e "key01 Nvalue01-1 Nvalue01-2 Nvalue01-3\nkey02 Nvalue02-1 Nvalue02-2 Nvalue02-3 \nkey03 Nvalue03-1... (2 Replies)
Discussion started by: alex2005
2 Replies
LEARN ABOUT DEBIAN
locale::msgcat
Msgcat(3pm) User Contributed Perl Documentation Msgcat(3pm)NAME
Locale::Msgcat - Perl extension for blah blah blah
SYNOPSIS
use Locale::Msgcat;
$cat = new Locale::Msgcat;
$rc = $cat->catopen(name, oflag);
$msg = $cat->catgets(set_number, message_number, string);
$rc = $cat->catclose();
DESCRIPTION
The Locale::Msgcat module allows access to the message catalog functions which are available on some systems. A new Locale::Msgcat object
must first be created for each catalog which has to be open at a given time.
The catopen operation opens the catalog whose name is given as argument. The oflag can be either 0 or NL_CAT_LOCALE (usually 1) which is
the recommended value.
The catgets message retrieves message_number for the set_number message set, and if not found returns string.
The catclose function should be used when access to a catalog is not needed anymore.
EXAMPLES
use Locale::Msgcat;
$cat = new Locale::Msgcat;
unless ($cat->catopen("whois.cat", 1)) {
print STDERR "Can't open whois catalog.
";
exit(1);
}
printf "First message, first set : %s
", $cat->catgets(1, 1, "not found");
unless ($cat->catclose()) {
print STDERR "Can't close whois catalog.
";
exit(1);
}
The above example would print the first message from the first message set found in the whois catalog, or if not found it would print "not
found".
AUTHOR
Christophe Wolfhugel, wolf@pasteur.fr
SEE ALSO catopen(3), catclose(3), catgets(3), perl(1).
perl v5.14.2 1999-11-15 Msgcat(3pm)