There are exactly 2 lines following PATTERN.
I need output to be one line with PATTERN, LINE1 and LINE2 concatenated.
That is, output from input file above should be :
How can such 3 linies be joined using sed or awk ?
Regards,
Hench
Last edited by Scrutinizer; 10-17-2016 at 03:31 PM..
Reason: code tags
Hi,
I have data with broken lines:
Sample data:
"12"|"25"|"a"|"b"|"c"|"d"|"e"|"f"|"2453748"|"08:10:50"
"16"|"25"|"a"|"b"|"c"|"d"|"e"|"f"|"
2453748"|"08:15:50"
"16"|"25"|"a"|"b"|"
c"|"d"|"e"|"f"|"2453748"|"08:19:50"
"16"|"25"|"a"|"b"|"c"|"d"|"e"|"f"|"2453748"|"08:19:50"
In the... (5 Replies)
I was wondering someone might be able to push me in the right direction, I am writing a script to modify fixed-width spool files, As you can see below the original spool file broke a single line into two for printability sake.
I have had been able do the joins using sed, the thing I am... (10 Replies)
Hi guys,
anyone know how can i join multiples lines using sed till the end of a file and output to another file in a single line?
The end of each line will be replaced with a special char "#".
I am using the below SED command, however it seems to remove the last 2 lines. Also not all lines... (12 Replies)
Hi,
I lack the utter fundamentals on how to craft an awk script.
I have hundreds of text files that were mangled by .doc format so all the lines are broken up so I need to join all of the lines of text into a single line. Normally I use vim command "ggVGJ" to join all lines but with so many... (3 Replies)
Hello,
Could someone help me with sed. I have searched for solution 5 days allready :wall:, but cant find. Unfortunately my "sed" knowledge not good enough to manage it. I have the text:
123, foo1, bar1, short text1, dat1e, stable_pattern
124, foo2, bar2, long text
with few
lines, date,... (4 Replies)
Hello ,
I will need your help once again.
I have the following file:
cat file02.txt
PATTERN XXX.YYY.ZZZ. 500
ROW01 aaa. 300 XS 14
ROW 45 29 AS XD.FD.
PATTERN 500 ZZYN002
ROW gdf gsste
ALT 267 fhhfe.ddgdg.
PATTERN ERE.MAY. 280
PATTERRNTH 5000 rt.rt.
ROW SO a 678
PATTERN... (2 Replies)
Hi all
OS - RHEL6.4
I have input file -f1.txt
I need to search line which starts with \Start and read next line till it gets blank line and join them all. I need to trim any trailing spaces for each line.So output.txt should be..
\Start\now\fine stepwatch this space for toolsends... (7 Replies)
Discussion started by: krsnadasa
7 Replies
LEARN ABOUT DEBIAN
config::model::backend::yaml
Config::Model::Backend::Yaml(3pm) User Contributed Perl Documentation Config::Model::Backend::Yaml(3pm)NAME
Config::Model::Backend::Yaml - Read and write config as a YAML data structure
VERSION
version 2.021
SYNOPSIS
use Config::Model ;
use Log::Log4perl qw(:easy) ;
use Data::Dumper ;
Log::Log4perl->easy_init($WARN);
# define configuration tree object
my $model = Config::Model->new ;
$model ->create_config_class (
name => "MyClass",
element => [
[qw/foo bar/] => {
type => 'leaf',
value_type => 'string'
},
baz => {
type => 'hash',
index_type => 'string' ,
cargo => {
type => 'leaf',
value_type => 'string',
},
},
],
read_config => [
{ backend => 'yaml' ,
config_dir => '/tmp',
file => 'foo.yml',
auto_create => 1,
}
],
) ;
my $inst = $model->instance(root_class_name => 'MyClass' );
my $root = $inst->config_root ;
my $step = 'foo=yada bar="bla bla" baz:en=hello
baz:fr=bonjour baz:hr="dobar dan"';
$root->load( step => $step ) ;
$inst->write_back ;
Now, "/tmp/foo.yml" contains:
---
bar: bla bla
baz:
en: hello
fr: bonjour
hr: dobar dan
foo: yada
DESCRIPTION
This module is used directly by Config::Model to read or write the content of a configuration tree written with YAML syntax in
"Config::Model" configuration tree.
Note that undefined values are skipped for list element. I.e. if a list element contains "('a',undef,'b')", the data structure will contain
'a','b'.
CONSTRUCTOR
new ( node => $node_obj, name => 'yaml' ) ;
Inherited from Config::Model::Backend::Any. The constructor will be called by Config::Model::AutoRead.
read ( io_handle => ... )
Of all parameters passed to this read call-back, only "io_handle" is used. This parameter must be IO::File object already opened for read.
It can also be undef. In this case, "read()" will return 0.
When a file is read, "read()" will return 1.
write ( io_handle => ... )
Of all parameters passed to this write call-back, only "io_handle" is used. This parameter must be IO::File object already opened for
write.
"write()" will return 1.
AUTHOR
Dominique Dumont, (ddumont at cpan dot org)
SEE ALSO
Config::Model, Config::Model::AutoRead, Config::Model::Backend::Any,
perl v5.14.2 2012-11-09 Config::Model::Backend::Yaml(3pm)