Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Printing the next line side by to the current line Post 302904419 by Scrutinizer on Wednesday 4th of June 2014 04:58:28 AM
Old 06-04-2014
Code:
awk 'NF{print $1} END{printf RS}' ORS=" " file

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk print the next line on the current line

Ok I have a file with hundreds of lines, four columns, space delimited, TESTB.TXT for example TESTB.TXT --- AA ZZ 12 34 BB YY 56 78 CC XX 91 23 DD VV 45 67 --- I want a new file that has 7 columns, the first four are identical, and the next 3 are the last three of the next line...so... (5 Replies)
Discussion started by: ajp7701
5 Replies

2. Shell Programming and Scripting

Need help in sed command [ printing a pattern + its line no or line no alone ]

Hello friends, Only very recently i started learning sed command...an i found that sed is faster in finding the patterns than some of my scripts that uses grep to check the patten inside a file using line by line search method which is time consuming. The below script... (4 Replies)
Discussion started by: frozensmilz
4 Replies

3. Shell Programming and Scripting

Vi Editor - How to paste the line concatenated with current line

I generally use yy to copy a line and then p to paste the line at end of current line. But is there a way to paste the copied line in concatenation with the current line with out going to next line. (3 Replies)
Discussion started by: paragkalra
3 Replies

4. Shell Programming and Scripting

printing 3 files side by side based on similar values in rows

Hi I'm trying to compare 3 or more files based on similar values and outputting them into 3 columns. For example: file1 ABC DEF GHI file2 DEF DER file3 ABC DER The output should come out like this file1 file2 file3 ABC ABC (4 Replies)
Discussion started by: zerofire123
4 Replies

5. Shell Programming and Scripting

Sed Comparing Parenthesized Values In Previous Line To Current Line

I am trying to delete lines in archived Apache httpd logs Each line has the pattern: <ip-address> - - <date-time> <document-request-URL> <http-response> <size-of-req'd-doc> <referring-document-URL> This pattern is shown in the example of 6 lines from the log in the code box below. These 6... (1 Reply)
Discussion started by: Proteomist
1 Replies

6. Shell Programming and Scripting

Echo printing a line in 2 lines; expected to print in one line

Dear All, fileName: therm.txt nc3h7o2h 7/27/98 thermc 3h 8o 2 0g 300.000 5000.000 1390.000 41 1.47017550e+01 1.71731699e-02-5.91205329e-06 9.21842570e-10-5.36438880e-14 2 -2.99988556e+04-4.93387892e+01 2.34710908e+00 4.34517484e-02-2.65357553e-05 3 ... (7 Replies)
Discussion started by: linuxUser_
7 Replies

7. Shell Programming and Scripting

Append Next line with current Line bassed on condition

Hi, I have an XML file and I am tring to extract some data form it, after lot of data cleaning process, I ended up with an issue, and need your urgent support. my current input data in below format: <Node>xxxxxx <Node>yyyyy</Node> <Node>zzzzzz <Node>12345</node> I need... (9 Replies)
Discussion started by: rramkrishnas
9 Replies

8. Shell Programming and Scripting

Copy Column Value Of Next Line Into Current Line

Hello All, I am looking for help to achieve the following: Here is the data set 1757890237|42|55570025|1468796400|0 1757890237|32|55570025|1471474800|0 1757890237|54|55570025|1474153200|1476745200 1757890237|34|55570026|1468796400|0 1757890237|44|55570026|1471474800|0... (7 Replies)
Discussion started by: angshuman
7 Replies

9. Shell Programming and Scripting

Printing string from last field of the nth line of file to start (or end) of each line (awk I think)

My file (the output of an experiment) starts off looking like this, _____________________________________________________________ Subjects incorporated to date: 001 Data file started on machine PKSHS260-05CP ********************************************************************** Subject 1,... (9 Replies)
Discussion started by: samonl
9 Replies

10. Shell Programming and Scripting

How to run 2 python scripts at the same time side by side on the same line?

Could I run 2 python scripts at the same time side by side output on the same line in this same format but with scripts? from itertools import izip_longest with open("file1") as textfile1, open("file2") as textfile2: for x, y in izip_longest(textfile1, textfile2, fillvalue=""): x =... (4 Replies)
Discussion started by: bigvito19
4 Replies
AnyEvent::XMPP::Ext::Disco(3pm) 			User Contributed Perl Documentation			   AnyEvent::XMPP::Ext::Disco(3pm)

NAME
AnyEvent::XMPP::Ext::Disco - Service discovery manager class for XEP-0030 SYNOPSIS
use AnyEvent::XMPP::Ext::Disco; my $con = AnyEvent::XMPP::IM::Connection->new (...); $con->add_extension (my $disco = AnyEvent::XMPP::Ext::Disco->new); $disco->request_items ($con, 'romeo@montague.net', undef, sub { my ($disco, $items, $error) = @_; if ($error) { print "ERROR:" . $error->string . " " } else { ... do something with the $items ... } } ); DESCRIPTION
This module represents a service discovery manager class. You make instances of this class and get a handle to send discovery requests like described in XEP-0030. It also allows you to setup a disco-info/items tree that others can walk and also lets you publish disco information. This class is derived from AnyEvent::XMPP::Ext and can be added as extension to objects that implement the AnyEvent::XMPP::Extendable interface or derive from it. METHODS
new (%args) Creates a new disco handle. set_identity ($category, $type, $name) This sets the identity of the top info node. $name is optional and can be undef. Please note that $name will overwrite all previous set names! If $name is undefined then no previous set name is overwritten. For a list of valid identites look at: http://www.xmpp.org/registrar/disco-categories.html Valid identity $types for "$category = "client"" may be: bot console handheld pc phone web unset_identity ($category, $type) This function removes the identity $category and $type. enable_feature ($uri) This method enables the feature $uri, where $uri should be one of the values from the Name column on: http://www.xmpp.org/registrar/disco-features.html These features are enabled by default: http://jabber.org/protocol/disco#info http://jabber.org/protocol/disco#items You can pass also a list of features you want to enable to "enable_feature"! disable_feature ($uri) This method enables the feature $uri, where $uri should be one of the values from the Name column on: http://www.xmpp.org/registrar/disco-features.html You can pass also a list of features you want to disable to "disable_feature"! request_items ($con, $dest, $node, $cb) This method does send a items request to the JID entity $from. $node is the optional node to send the request to, which can be undef. $con must be an instance of AnyEvent::XMPP::Connection or a subclass of it. The callback $cb will be called when the request returns with 3 arguments: the disco handle, an AnyEvent::XMPP::Ext::Disco::Items object (or undef) and an AnyEvent::XMPP::Error::IQ object when an error occured and no items were received. The timeout of the request is the IQ timeout of the connection $con. $disco->request_items ($con, 'a@b.com', undef, sub { my ($disco, $items, $error) = @_; die $error->string if $error; # do something with the items here ;_) }); request_info ($con, $dest, $node, $cb) This method does send a info request to the JID entity $from. $node is the optional node to send the request to, which can be undef. $con must be an instance of AnyEvent::XMPP::Connection or a subclass of it. The callback $cb will be called when the request returns with 3 arguments: the disco handle, an AnyEvent::XMPP::Ext::Disco::Info object (or undef) and an AnyEvent::XMPP::Error::IQ object when an error occured and no items were received. The timeout of the request is the IQ timeout of the connection $con. $disco->request_info ($con, 'a@b.com', undef, sub { my ($disco, $info, $error) = @_; die $error->string if $error; # do something with info here ;_) }); AUTHOR
Robin Redeker, "<elmex at ta-sa.org>", JID: "<elmex at jabber.org>" COPYRIGHT &; LICENSE Copyright 2007, 2008 Robin Redeker, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-01-23 AnyEvent::XMPP::Ext::Disco(3pm)
All times are GMT -4. The time now is 12:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy