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
STRIPCHART(5)							File Formats Manual						     STRIPCHART(5)

NAME
stripchart - draws diagrams from data with PHP SYNOPSIS
The script is expected to be called as a CGI script but also works from the command line. DESCRIPTION
Stripchart prepares a series of diagrams directly from raw data. It is handy for web pages that need some graphics without too much over- head. OPTIONS
-i input FILE name of input data file (mandatory) -o output FILE name of output .gif file (default: STDOUT) -O output FILE name of output .gif file, also dumps to STDOUT -f from TIME stripchart with data starting at TIME (default: 24 hours ago) -t to TIME stripchart with data ending at TIME (default: now) -r range RANGE stripchart data centered around "from" time the size of RANGE (overrides -t) -l last LINES stripchart last number of LINES in data file (overrides -f and -t and -r) -T title TITLE title to put on graphic (default: FILE RANGE) -x column X time or "x" column (default: 2) -y column Y value or "y" column (default: 3) -Y column Y' overplot second "y" column (default: none) -b baseline VALUE overplot baseline of arbitrary value VALUE -B baseline-avg overrides -b, it plots baseline of computed average -d dump low VALUE ignore data less than VALUE -D dump high VALUE ignore data higher than VALUE -v verbose puts verbose runtime output to STDERR -L log makes y axis log scale -c colors "COLORS" set gnuplot colors for graph/axisnts/data (default: "xffffff x000000 xc0c0c0 x00a000 x0000a0 x2020c0" in order: bground, axisnts, grids, pointcolor1,2,3) -C cgi output CGI header to STDOUT if being called as CGI -s stats turn extra plot stats on (current, avg, min, max) -j julian times time columns is in local julian date (legacy stuff) -V version print version number and exit -h help display this help NOTES
* TIME either unix date, julian date, or civil date in the form: YYYY:MM:DD:HH:MM (year, month, day, hour, minute) If you enter something with colons, it assumes it is civil date If you have a decimal point, it assumes it is julian date If it is an integer, it assumes it is unix date (epoch seconds) If it is a negative number, it is in decimal days from current time (i.e. -2.5 = two and a half days ago) * All times on command line are assumed to be "local" times * All times in the data file must be in unix date (epoch seconds) * RANGE is given in decimal days (i.e. 1.25 = 1 day, 6 hours) * if LINES == 0, (i.e. -l 0) then the whole data file is read in * columns (given with -x, -y, -Y flags) start at 1 * titles given with -T can contain the following key words which will be converted: FILE - basename of input file RANGE - pretty civil date range (in local time zone) the default title is: FILE RANGE AUTHORS
Matt Lebofsky 2.21 November 2002 STRIPCHART(5)
All times are GMT -4. The time now is 01:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy