Sponsored Content
Full Discussion: Combine 2 lines
Top Forums Shell Programming and Scripting Combine 2 lines Post 302535812 by guruprasadpr on Friday 1st of July 2011 09:12:04 PM
Old 07-01-2011
Hi

Code:
awk '/^BUM/{print x,$0;}{x=$0}' file

Guru.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Combine two lines

I have a file called test.txt. Inside this file is the following: tcenh100.telkom.co.za 100.200.300.400 tcenh101.telkom.co.za 500.600.700.800 I want to take out the new lines and spaces, then I want to put the ip address of the host name next to the host name on the same line, as soon as... (7 Replies)
Discussion started by: wolf
7 Replies

2. UNIX for Dummies Questions & Answers

Combine two lines

Hi I have a file with the records 1 A B C D 2 E F G H 3 I J K L 4 M N O P In the ouput I want 1 A B C D 2 # F G H 3 I J K L 4 M N O P How to achieve this? (10 Replies)
Discussion started by: superprg
10 Replies

3. Shell Programming and Scripting

combine 2 lines

Moderator, kindly delete this thread because I already found what I needed... thanks. (0 Replies)
Discussion started by: Deanne
0 Replies

4. UNIX for Dummies Questions & Answers

How do I combine the last 2 lines of a file

I tried to put the history line number and the date into the file with one command, and failed. Can't figure out how to get the date variable substituted for the last space captured. history | tail -1 | sed -e 's/.\{7\}/&/g' | head -1 | sed 's/ $/$date/' Result was: 729 $date So, I... (8 Replies)
Discussion started by: jimbob75
8 Replies

5. Shell Programming and Scripting

How to combine lines?

Hi, I have a file like this: "sdfc@abc.com","arovls","some addr ", "more stuff" "ssss@email.com","arovls","some addr", "sss" "edx@email.com","arovls","some addr", "sssdfvv" "ssss@a55.com","arovls","some addr", "lsdsdgf" "ssss@0234.com","aro vls","123 Main", "lSdfv" I want to... (4 Replies)
Discussion started by: erniel
4 Replies

6. Shell Programming and Scripting

combine 2 lines

Hello, I want to combine 2 lines in one I have a text file example: bla123 blo31 xx:yy:zz ->bla43 bli532 00:01:02 bla1237 blo351 aa:ss:dd ->bla433 bli34332 55:10:28 I want the result to be: bla123 blo31 xx:yy:zz, ->bla43 bli532 00:01:02 bla1237 blo351 aa:ss:dd, ->bla433 bli34332... (3 Replies)
Discussion started by: Petko Meshov
3 Replies

7. UNIX for Dummies Questions & Answers

how can I combine 2 lines into one?

Hi, I have a file like this: A 1 B 2 C 3 ... And I want to have just one line like this: A 1 B 2 C 3 ... How can I do it? Thanks! (4 Replies)
Discussion started by: elsagarcia
4 Replies

8. UNIX for Dummies Questions & Answers

Combine lines in file

Hi All, I am trying to understand if its possible to carry out the following. I have a text file which contains output from multiple commands, within the file a node will be quiered twice if there was 2 commands for example. Is it possible do combine 2 lines into 1 if the first word is the... (1 Reply)
Discussion started by: mutley2202
1 Replies

9. Shell Programming and Scripting

awk to combine lines if fields match in lines

In the awk below, what I am attempting to do is check each line in the tab-delimeted input, which has ~20 lines in it, for a keyword SVTYPE=Fusion. If the keyword is found I am splitting $3 using the . (dot) and reading the portion before and after the dot in an array a. If it does have that... (12 Replies)
Discussion started by: cmccabe
12 Replies

10. Shell Programming and Scripting

awk to remove lines that do not start with digit and combine line or lines

I have been searching and trying to come up with an awk that will perform the following on a converted text file (original is a pdf). 1. Since the first two lines are (begin with) text they are removed 2. if $1 is a number then all text is merged (combined) into one line until the next... (3 Replies)
Discussion started by: cmccabe
3 Replies
Courier::Filter::Logger(3pm)				User Contributed Perl Documentation			      Courier::Filter::Logger(3pm)

NAME
Courier::Filter::Logger - Abstract base class for loggers used by the Courier::Filter framework SYNOPSIS
Courier::Filter logging use Courier::Filter::Logger::My; # Need to use a non-abstract sub-class. my $logger = Courier::Filter::Logger::My->new(%options); # For use in an individual filter module: my $module = Courier::Filter::Module::My->new( ... logger => $logger, ... ); # For use as a global Courier::Filter logger object: my $filter = Courier::Filter->new( ... logger => $logger, ... ); Deriving new logger classes package Courier::Filter::Logger::My; use base qw(Courier::Filter::Logger); DESCRIPTION
Sub-classes of Courier::Filter::Logger are used by the Courier::Filter mail filtering framework and its filter modules for the logging of errors and message rejections to arbitrary targets, like file handles or databases. When overriding a method in a derived class, do not forget calling the inherited method from your overridden method. Constructor The following constructor is provided and may be overridden: new(%options): returns Courier::Filter::Logger Creates a new logger using the %options given as a list of key/value pairs. Initializes the logger, by creating/opening I/O handles, connecting to databases, etc.. "Courier::Filter::Logger::new()" creates a hash-ref as an object of the invoked class, and stores the %options in it, but does nothing else. Destructor The following destructor is provided and may be overridden: destroy Uninitializes the logger, by closing I/O handles, disconnecting from databases, etc.. "Courier::Filter::Logger::destroy()" does nothing. Sub-classes may override this method and define clean-up behavior. Instance methods The following instance methods are provided and may be overridden: log_error($text) Logs the error message given as $text (a string which may contain newlines). "Courier::Filter::Logger::log_error()" does nothing and should be overridden. log_rejected_message($message, $reason) Logs the Courier::Message given as $message as having been rejected due to $reason (a string which may contain newlines). "Courier::Filter::Logger::log_rejected_message()" does nothing and should be overridden. SEE ALSO
Courier::Filter, Courier::Filter::Module. For a list of prepared loggers that come with Courier::Filter, see "Bundled Courier::Filter loggers" in Courier::Filter::Overview. For AVAILABILITY, SUPPORT, and LICENSE information, see Courier::Filter::Overview. AUTHOR
Julian Mehnle <julian@mehnle.net> perl v5.14.2 2011-12-27 Courier::Filter::Logger(3pm)
All times are GMT -4. The time now is 01:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy