Sponsored Content
Full Discussion: Combine output on same line
Top Forums Shell Programming and Scripting Combine output on same line Post 302157616 by Franklin52 on Friday 11th of January 2008 01:10:13 PM
Old 01-11-2008
One possibility with awk:

Code:
awk '!f{a=$0;f=1;next}{printf("%s | %s\n", a, $0); f=0}' file

Regards
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Combine Two Commands Output

How i can combine output of two commands in one file.......i tried this but it is not working although each command is working good seperately..... head -1 filename | tail -1 filename i think there is problem with command concatenator? (16 Replies)
Discussion started by: 33junaid
16 Replies

2. UNIX for Dummies Questions & Answers

combine files line by line

Hi all, I once knew of a simple unix command to do this, but I can't remember it and I can't find it by searching. I have two files. ### FILE A #### A1 A2 A3 A4 A5 ### FILE B #### B1 B2 B3 B4 B5 (2 Replies)
Discussion started by: Digby
2 Replies

3. Shell Programming and Scripting

Combine line before the pattern

Hi, I am not very familiar with sed and awk and i have a huge file to process which is impossible to do manually. I want to print out beginning from "Network" until end of line only (excluding the Version). AND. the decription to be all in one line. File: Version: 2.0 Network: xxx... (9 Replies)
Discussion started by: The One
9 Replies

4. Shell Programming and Scripting

How to combine 2 files and output the unique & difference?

Hi Guys, I have two input files and I want to combine them and get the unique values and differences and put them into one file. See below desired output file. Inputfile1: 1111111 2222222 3333333 7860068 7860069 7860071 7860072 Inputfile2: 4444444 (4 Replies)
Discussion started by: pinpe
4 Replies

5. Shell Programming and Scripting

Combine multiline to one line till a blank line

Hello, I have a file as :- ABC DEF GHI JKL <BlankLine> MNO PQR STU VWX <BlankLine> YZA I need it as below:- ABCDEFGHIJKL; MNOPQRSTUVWX; (3 Replies)
Discussion started by: jassi10781
3 Replies

6. Shell Programming and Scripting

Pipe or combine output of three awk commands

What is the correct syntax to pipe or run three awk commands? Basically, using the output of the first awk as input in the second. Then using the output of the second awk in the third. Thank you :). awk 'FNR==NR {E; next }$3 in E {print $3, $5}' panel_genes.txt RefSeqGene.txt > update.txt |... (3 Replies)
Discussion started by: cmccabe
3 Replies

7. Shell Programming and Scripting

awk to combine lines from line with pattern match to a line that ends in a pattern

I am trying to combine lines with these conditions: 1. First line starts with text of "libname VALUE db2 datasrc" where VALUE can be any text. 2. If condition1 is met then continue to combine lines through a line that ends with a semicolon. 3. Ignore case when matching patterns and remove any... (5 Replies)
Discussion started by: Wes Kem
5 Replies

8. UNIX for Dummies Questions & Answers

Combine Both Output from the awk Script

Hi, Is there anyway to combine output from the awk scripting. file01.txt: AUE_CHMOD AUE_CHOWN AUE_CHROOT AUE_CONNECT AUE_ACCEPT AUE_FCHOWN AUE_FCHMOD AUE_SETREUID AUE_SETREGID AUE_FCHROOT AUE_PFEXEC AUE_SETUID AUE_NICE AUE_SETGID (9 Replies)
Discussion started by: alvinoo
9 Replies

9. Shell Programming and Scripting

Combine incrimental line

hi guys, i am writing a bash script.. that produce output some thing like this: road 100 300 500 road 100 300 500 road 100 300 500 road 100 300 500 street 400 200 700 street 400 200 700 path 200 100 900 i would like to combine all the entries that having the same but incremental (not... (12 Replies)
Discussion started by: pedot
12 Replies

10. UNIX for Beginners Questions & Answers

Get an output of lines in pattern 1st line then 10th line then 11th line then 20th line and so on.

Input file: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 (6 Replies)
Discussion started by: Sagar Singh
6 Replies
CONVDATE(1)						      General Commands Manual						       CONVDATE(1)

NAME
convdate - convert time/date strings and numbers SYNOPSIS
convdate [ -c ] [ -n ] [ -s ] arg... DESCRIPTION
Convdate translate the date/time strings specified as arguments on its command line, outputting the results one to a line. OPTIONS
-c If the ``-c'' flag is used, then each argument is taken to be a time_t and is output in ctime format. -n If the ``-n'' flag is used, then each argument is taken as a date string to be parsed by parsedate(3) and is output as a time_t; see time(2). -s If the ``-s'' flag is used, then each argument is taken as a date string to be parsed by parsedate(3) and is output as a string for- matted by ctime(3). This is the default. EXAMPLES
% convdate 'feb 10 10am' Sun Feb 10 10:00:00 1991 % convdate 12pm 5/4/90 Fri Dec 13 00:00:00 1991 Fri May 4 00:00:00 1990 % convdate -n 'feb 10 10am' '12pm 5/4/90' 666198000 641880000 % convdate -c 666198000 Sun Feb 10 10:00:00 1991 HISTORY
Written by Rich $alz <rsalz@uunet.uu.net>. This is revision 1.2, dated 1998/05/20. SEE ALSO
parsedate(3). CONVDATE(1)
All times are GMT -4. The time now is 01:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy