Hello Experts,
I have a file "tt.txt" which is like:
#a1=a2
b1=b2
#c1=c2
I need to remove the pound (#) sign from a particular line. In this case let us assume it's 3rd line : "#c1=c2"
I can do it through:
sed "s/#c1=c2/c1=c2/" tt.txtbut it is possible that I may not know the value... (6 Replies)
Hi...
i need a script to remove the space before and after the operator like( / ).
Ex :
Input file
apple / manago
mango / fresh apple / fresh
Desired output:
apple/manago
mango/fresh apple/fresh
Note: betwee the desired operator space should be removed, between words do not remove... (3 Replies)
Hello!
Please bare with me, I'm a total newbie to scripting. Here's the sudo code of what I'm trying to do:
Get file name
Does file exist?
If true
get length of file name
get network id (this will be the last 3 numbers of the file name)
loop x 2
If... (1 Reply)
I'd like to remove (do a pattern or precise replacement - this I can handle in SED using Regex )
---AFTER THE 1ST Occurrence ( i.e. on the 2nd occurrence - from the 2nd to fourth occurance ) of a specific string : type 1
-- After the 1st occurrence of 1 string1 till the 1st occurrence of... (4 Replies)
Below i am trying to remove "/" and "r" from the output, so i need output as:
hdiskpower3
hdisk0
hdisk1
#inq | grep 5773 | awk '{print $1}' | sed 's/dev//g' | awk -F"/" '{$1=$1}1'
.....................................................//rhdiskpower0
//rhdiskpower1
//rhdiskpower2... (3 Replies)
Hi
I need help on this ..!!
Input :
xx_abc_regA
xx_def_regB
xx_qwe_regC
Now i required the output as the below
abc
def
qwe
Need to remove last occurrence of character (_) and rest of the string in Unix (sed).
Thanks in Advance ..!!!
-Nallachand (3 Replies)
hello.
How to remove all characters in a line from first character ( a $ ) until and including the third occurrence of that character ( $ ).
Any help is welcome. (10 Replies)
I have a file which comes every day and the file data look's as below.
Vi abc.txt
a|b|c|d\n
a|g|h|j\n
Some times we receive the file with only a new line character in the file like
vi abc.txt
\n (8 Replies)
Hi
I have file in below format. How i can remove the first and lost comma from this below file
,001E:001F,,,02EE,0FED:0FEF,
I need output has below
001E:001F,,,02EE,0FED:0FEF (6 Replies)
Discussion started by: ranjancom2000
6 Replies
LEARN ABOUT DEBIAN
bind::config::parser
BIND::Config::Parser(3pm) User Contributed Perl Documentation BIND::Config::Parser(3pm)NAME
BIND::Config::Parser - Parse BIND Config file.
SYNOPSIS
use BIND::Config::Parser;
# Create the parser
my $parser = new BIND::Config::Parser;
my $indent = 0;
# Set up callback handlers
$parser->set_open_block_handler( sub {
print " " x $indent, join( " ", @_ ), " {
";
$indent++;
} );
$parser->set_close_block_handler( sub {
$indent--;
print " " x $indent, "};
";
} );
$parser->set_statement_handler( sub {
print " " x $indent, join( " ", @_ ), ";
";
} );
# Parse the file
$parser->parse_file( "named.conf" );
DESCRIPTION
BIND::Config::Parser provides a lightweight parser to the configuration file syntax of BIND v8 and v9 using a "Parse::RecDescent" grammar.
It is in a similar vein to "BIND::Conf_Parser". However, as it has no knowledge of the directives, it doesn't need to be kept updated as
new directives are added, it simply knows how to carve up a BIND configuration file into logical chunks.
CONSTRUCTOR
new( );
Create a new "BIND::Config::Parser" object.
METHODS
set_open_block_handler( CODE_REF );
Set the code to be called when a configuration block is opened. At least one argument will be passed; the name of that block, for
example "options" or "zone", etc. as well as any additional items up to but not including the opening curly brace.
set_close_block_handler( CODE_REF );
Set the code to be called when a configuration block is closed. No arguments are passed.
set_statement_handler( CODE_REF );
Set the code to be called on a single line configuration element. At least one argument will be passed; the name of that element, as
well as any additional items up to but not including the ending semi-colon.
parse_file( FILENAME );
Parse FILENAME, triggering the above defined handlers on the relevant sections.
TODO
Probably the odd one or two things. I'm fairly sure the grammar is correct.
COPYRIGHT AND LICENSE
Copyright (c) 2005 Matt Dainty.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
AUTHORS
Matt Dainty <matt@bodgit-n-scarper.com>.
SEE ALSO
perl, Parse::RecDescent, BIND::Conf_Parser.
perl v5.14.2 2005-06-26 BIND::Config::Parser(3pm)