Sponsored Content
Full Discussion: Join multiple lines
Top Forums Shell Programming and Scripting Join multiple lines Post 302771910 by hench on Friday 22nd of February 2013 05:48:01 AM
Old 02-22-2013
Join multiple lines

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
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Awk Join multiple lines

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)
Discussion started by: hitmansilentass
5 Replies

2. Shell Programming and Scripting

join on a file with multiple lines, fields

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)
Discussion started by: crimper
5 Replies

3. Programming

sql,multiple join,outer join issue

example sql: select a.a1,b.b1,c.c1,d.d1,e.e1 from a left outer join b on a.x=b.x left outer join c on b.y=c.y left outer join d on d.z=a.z inner join a.t=e.t I know how single outer or inner join works in sql. But I don't really understand when there are multiple of them. can... (0 Replies)
Discussion started by: robbiezr
0 Replies

4. UNIX for Dummies Questions & Answers

Join 2 files with multiple columns: awk/grep/join?

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)
Discussion started by: InfoSeeker
3 Replies

5. Shell Programming and Scripting

How to use SED to join multiple lines?

Hi guys, 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... (12 Replies)
Discussion started by: DrivesMeCrazy
12 Replies

6. UNIX for Dummies Questions & Answers

How to use the the join command to join multiple files by a common column

Hi, I have 20 tab delimited text files that have a common column (column 1). The files are named GSM1.txt through GSM20.txt. Each file has 3 columns (2 other columns in addition to the first common column). I want to write a script to join the files by the first common column so that in the... (5 Replies)
Discussion started by: evelibertine
5 Replies

7. Shell Programming and Scripting

Join common patterns in multiple lines into one line

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)
Discussion started by: Harrisham
4 Replies

8. Shell Programming and Scripting

Removing multiple lines from input file, if multiple lines match a pattern.

GM, I have an issue at work, which requires a simple solution. But, after multiple attempts, I have not been able to hit on the code needed. I am assuming that sed, awk or even perl could do what I need. I have an application that adds extra blank page feeds, for multiple reports, when... (7 Replies)
Discussion started by: jxfish2
7 Replies

9. Shell Programming and Scripting

Join multiple lines from text file

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)
Discussion started by: budz26
3 Replies

10. Shell Programming and Scripting

Join columns across multiple lines in a Text based on common column using BASH

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
XDrawLines()															      XDrawLines()

Name
  XDrawLines - draw multiple connected lines.

Synopsis
  XDrawLines(display, drawable, gc, points, npoints, mode)
	Display *display;
	Drawable drawable;
	GC gc;
	XPoint *points;
	int npoints;
	int mode;

Arguments
  display   Specifies a connection to an X server; returned from XOpenDisplay().

  drawable  Specifies the drawable.

  gc	    Specifies the graphics context.

  points    Specifies a pointer to an array of points.

  npoints   Specifies the number of points in the array.

  mode	    Specifies the coordinate mode.  Pass either CoordModeOrigin or CoordModePrevious.

Description
  XDrawLines() draws a series of lines joined end-to-end.

  It  draws lines connecting each point in the list (points array) to the next point in the list.  The lines are drawn in the order listed in
  the points array.  For any given line, no pixel is drawn more than once.  If thin (zero line width) lines intersect, pixels will  be	drawn
  multiple  times.  If the first and last points coincide, the first and last lines will join correctly.  If wide lines intersect, the inter-
  secting pixels are drawn only once, as though the entire multiline request were a single filled shape.

  There is a limit to the number of lines that can be drawn in a single call, which varies according to the server.  To  determine  how  many
  lines  you  can  draw  in a single call, find out your server's maximum request size using XMaxRequestSize().  Subtract three and divide by
  two, and this is the maximum number of lines you can draw in a single XDrawLines() call.

  The mode argument may have two values:

  o  CoordModeOrigin indicates that all points are relative to the drawable's origin.

  o  CoordModePrevious indicates that all points after the first are relative to the previous point.  (The first point is always relative  to
     the drawable's origin.)

  XDrawLines()	uses  the  following components of the specified graphics context to draw multiple connected lines in the specified drawable:
  function, plane_mask, line_width, line_style,  cap_style,  join_style,  fill_style,  subwindow_mode,	clip_x_origin,	clip_y_  origin,  and
  clip_mask.   This function also uses these graphics context mode-dependent components:  foreground, background, tile, stipple, ts_x_origin,
  ts_y_origin, dash_offset, and dashes.

  For more information, see Volume One, Chapter 6, Drawing Graphics and Text, and Chapter 5, The Graphics Context.

Structures
     typedef struct {
	 short x, y;
     } XPoint;

Errors
  BadDrawable
	    Specified drawable is invalid.

  BadGC     Specified GC is invalid, or does not match the depth of drawable.

  BadMatch  Specified drawable is an InputOnly window.

  BadValue  Invalid coordinate_mode.

See Also
  XClearArea(), XClearWindow(), XCopyArea(), XCopyPlane(), XDraw, XDrawArc(), XDrawArcs(), XDrawFilled(), XDrawLine(),	XDrawPoint(),  XDraw-
  Points(),  XDrawRectangle(),	XDrawRectangles(),  XDrawSegments(),  XFillArc(), XFillArcs(), XFillPolygon(), XFillRectangle(), XFillRectan-
  gles().

Xlib - Drawing Primitives													      XDrawLines()
All times are GMT -4. The time now is 09:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy