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 are joined together.
Example of Input File:
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've looked at the join command which is able to perform what I need on two rows with a common field, however if I have more than two rows I need to join all of them.
Thus I have one file with multiple rows to be joined on an index number:
1 randomtext1
2 rtext2
2 rtext3
3 rtext4
3 rtext5... (5 Replies)
Hello,
My apologies if this has been posted elsewhere, I have had a look at several threads but I am still confused how to use these functions. I have two files, each with 5 columns:
File A: (tab-delimited)
PDB CHAIN Start End Fragment
1avq A 171 176 awyfan
1avq A 172 177 wyfany
1c7k A 2 7... (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)
Hi
I have a source file ( written i C ) where a funtion call is spread over multiple lines, for example :
func(
a,
b,
c
);
I want this to be joined into one single line :
func(a,b,c);
How can this be done with awk and sed ?
Regards. Hench (2 Replies)
Hi
I have a file like
1 2
1 2 3
1 5 6
11 12
10 2
7 5
17 12
I would like to have an output as
1 2 3 5 6 10 7
11 12 17
any help would be highly appreciated
Thanks (4 Replies)
Hi Guys,
Could you please advise how to join multiple details lines into single row, with HEADER 1 as the record separator and comma(,) as the field separator.
Input:
HEADER 1, HEADER 2, HEADER 3,
11,22,33,
COLUMN1,COLUMN2,COLUMN3,
AA1, BB1, CC1,
END: ABC
HEADER 1, HEADER 2,... (3 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)
Hello,
I have a file with 2 columns ( tableName , ColumnName) delimited by a Pipe like below . File is sorted by ColumnName.
Table1|Column1
Table2|Column1
Table5|Column1
Table3|Column2
Table2|Column2
Table4|Column3
Table2|Column3
Table2|Column4
Table5|Column4
Table2|Column5
From... (6 Replies)
Discussion started by: nv186000
6 Replies
LEARN ABOUT DEBIAN
log::agent::channel::handle
Agent::Channel::Handle(3pm) User Contributed Perl Documentation Agent::Channel::Handle(3pm)NAME
Log::Agent::Channel::Handle - I/O handle logging channel for Log::Agent
SYNOPSIS
require Log::Agent::Channel::Handle;
my $driver = Log::Agent::Channel::Handle->make(
-prefix => "prefix",
-stampfmt => "own",
-showpid => 1,
-handle => *FILE,
);
DESCRIPTION
The handle channel performs logging to an already opened I/O handle, along with the necessary prefixing and stamping of the messages.
The creation routine make() takes the following arguments:
"-handle" => handle
Specifies the I/O handle to use. It can be given as a GLOB reference, such as "*FILE", or as an "IO::Handle" object.
NOTE: Auto-flushing is not enabled on the handle. Even when the channel is closed, the handle is left as-is: we simply stop sending
log messages to it.
"-no_newline" => flag
When set to true, never append any "
" (on Unix) or "
" (on Windows) to log messages.
Internally, Log::Agent relies on the channel to delimit logged lines appropriately, so this flag is not used. However, it might be
useful for "Log::Agent::Logger" users.
Default is false, meaning newline markers are systematically appended.
"-no_prefixing" => flag
When set to true, disable the prefixing logic entirely, i.e. the following options are ignored completely: "-prefix", "-showpid",
"-no_ucfirst", "-stampfmt".
Default is false.
"-no_ucfirst" => flag
When set to true, don't upper-case the first letter of the log message entry when there's no prefix inserted before the logged line.
When there is a prefix, a ":" character follows, and therefore the leading letter of the message should not be upper-cased anyway.
Default is false, meaning uppercasing is performed.
"-prefix" => prefix
The application prefix string to prepend to messages.
"-showpid" => flag
If set to true, the PID of the process will be appended within square brackets after the prefix, to all messages.
Default is false.
"-stampfmt" => (name | CODE)
Specifies the time stamp format to use. By default, my "own" format is used. See Log::Agent::Stamping for a description of the
available format names.
You may also specify a CODE ref: that routine will be called every time we need to compute a time stamp. It should not expect any
parameter, and should return a string.
CAVEAT
Beware of chdir(). If your program uses chdir(), you should always specify logfiles by using absolute paths, otherwise you run the risk of
having your relative paths become invalid: there is no anchoring done at the time you specify them. This is especially true when
configured for rotation, since the logfiles are recreated as needed and you might end up with many logfiles scattered throughout all the
directories you chdir()ed to.
AUTHOR
Raphael Manfredi <Raphael_Manfredi@pobox.com>
SEE ALSO Log::Agent::Logger(3), Log::Agent::Channel(3).
perl v5.10.0 2002-03-09 Agent::Channel::Handle(3pm)