Sponsored Content
Top Forums UNIX for Dummies Questions & Answers merge lines within a file that start with a similar pattern Post 302523475 by a_ba on Thursday 19th of May 2011 02:45:02 AM
Old 05-19-2011
merge lines within a file that start with a similar pattern

Hello! i have a text file.. which contains the data as follows
Quote:
int a,b,c
int d
float e,f,g
float h,i
float j
char m,p
char q,r
i want to merge the declarations lines pertaining to one datatype in to a single line as follows
Quote:
int a,b,c,d
float e,f,g,h,i,j
char m,p,q,r
i've searched the forum for help.. but couldn't find much help.. how can i do this??
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Urgent : Merge similar lines

Hi, I have a file like this. please notice that ./usr/orders1/order_new_2627 appears more than once, thus needs to be merged. I would like to merge the lines where the first column match so the output should be like this: Please help (2 Replies)
Discussion started by: rakeshou
2 Replies

2. Shell Programming and Scripting

Merge lines in text file based on pattern

Hello, I have searched forum trying to find a solution to my problem, but could not find anything or I did not understand the examples.... I should say, I am very inexperienced with text processing. I have a text file with approx 60k lines in it. I need to merge lines based on the number... (8 Replies)
Discussion started by: Bertik
8 Replies

3. Shell Programming and Scripting

Merge lines from one file if pattern matches

I have one comma separated file (a.txt) with two or more records all matching except for the last column. I would like to merge all matching lines into one and consolidate the last column, separated by ":". Does anyone know of a way to do this easily? I've searched the forum but most talked... (6 Replies)
Discussion started by: giannicello
6 Replies

4. Shell Programming and Scripting

merge same pattern lines together

Hi people... I normally find with out any problem the solutions I need just by searching. But for this I'm not having any joy or jsut failing to adapt what I'ev found to work. I have applciation report that doesn't allow for manipulation at creation so I want to do some post modifcation... (2 Replies)
Discussion started by: nhatch
2 Replies

5. Shell Programming and Scripting

Help with merge two file based on similar column content

Input file 1: A1BG A1BG A1BG A1CF A1CF BCAS BCAS A2LD1 A2M A2M HAT . . Input file 2: A1BG All A1CF TEMP (5 Replies)
Discussion started by: perl_beginner
5 Replies

6. Shell Programming and Scripting

Join all the lines matching similar pattern

I am trying to Join all the lines matching similar pattern. Example ; I wanted to join all the lines which has sam to a single line. In next line, i wanted to have all the lines with jones to a single line....etc > cat sample.txt sam 2012/11/23 sam 2012/12/5 sam 2012/12/5 jones... (2 Replies)
Discussion started by: evrurs
2 Replies

7. Shell Programming and Scripting

Need to merge lines based on pattern

Hi, I have a requirement to merge multiple lines based on search pattern. The search criteria is : it will search for CONSTRAINT and when it found CONSTRAINT, it will merge all lines to 1 line till it founds blank line. For Example: CREATE TABLE "AMS_DISTRIBUTOR_XREF" ( "SOURCE"... (5 Replies)
Discussion started by: satyaatcgi
5 Replies

8. Shell Programming and Scripting

sed Range Pattern and 2 lines before Start Pattern

Hi all, I have been searching all over Google but I am unable to find a solution for a particular result that I am trying to achieve. Consider the following input: 1 2 3 4 5 B4Srt1--Variable-0000 B4Srt2--Variable-1111 Srt 6 7 8 9 10 End (3 Replies)
Discussion started by: y2jacky
3 Replies

9. Shell Programming and Scripting

Bash/shell merge similar lines

Hello, I've been working on a bash script to parse through firewall logs (cisco). I'm nearing the end and have a dilemma. My data looks as such (actual data is several gigs worth of logs - without the headers): sourceIP destinationIP destinationProtocol destinationPort 1.1.1.1 2.2.2.2 ... (2 Replies)
Discussion started by: umang2382
2 Replies

10. Shell Programming and Scripting

Fetch lines between 1st and 4th similar pattern

Hi Folks, I have a big file that looks like below ========== kjhjl kjlklkkhcgflj fgf ========== xsww23edc ccdde3rfv ceerfcc vff4 ========== zaq12wsx xsw23edc ========== ========== (3 Replies)
Discussion started by: jayadanabalan
3 Replies
IMAGICKDRAW(3)								 1							    IMAGICKDRAW(3)

The ImagickDraw class

CLASS SYNOPSIS
ImagickDraw ImagickDraw o bool ImagickDraw::affine (array $affine) o bool ImagickDraw::annotation (float $x, float $y, string $text) o bool ImagickDraw::arc (float $sx, float $sy, float $ex, float $ey, float $sd, float $ed) o bool ImagickDraw::bezier (array $coordinates) o bool ImagickDraw::circle (float $ox, float $oy, float $px, float $py) o bool ImagickDraw::clear (void ) o ImagickDraw ImagickDraw::clone (void ) o bool ImagickDraw::color (float $x, float $y, int $paintMethod) o bool ImagickDraw::comment (string $comment) o bool ImagickDraw::composite (int $compose, float $x, float $y, float $width, float $height, Imagick $compositeWand) o ImagickDraw::__construct (void ) o bool ImagickDraw::destroy (void ) o bool ImagickDraw::ellipse (float $ox, float $oy, float $rx, float $ry, float $start, float $end) o string ImagickDraw::getClipPath (void ) o int ImagickDraw::getClipRule (void ) o int ImagickDraw::getClipUnits (void ) o ImagickPixel ImagickDraw::getFillColor (void ) o float ImagickDraw::getFillOpacity (void ) o int ImagickDraw::getFillRule (void ) o string ImagickDraw::getFont (void ) o string ImagickDraw::getFontFamily (void ) o float ImagickDraw::getFontSize (void ) o public int ImagickDraw::getFontStretch (void ) o int ImagickDraw::getFontStyle (void ) o int ImagickDraw::getFontWeight (void ) o int ImagickDraw::getGravity (void ) o bool ImagickDraw::getStrokeAntialias (void ) o ImagickPixel ImagickDraw::getStrokeColor (void ) o array ImagickDraw::getStrokeDashArray (void ) o float ImagickDraw::getStrokeDashOffset (void ) o int ImagickDraw::getStrokeLineCap (void ) o int ImagickDraw::getStrokeLineJoin (void ) o int ImagickDraw::getStrokeMiterLimit (void ) o float ImagickDraw::getStrokeOpacity (void ) o float ImagickDraw::getStrokeWidth (void ) o int ImagickDraw::getTextAlignment (void ) o bool ImagickDraw::getTextAntialias (void ) o int ImagickDraw::getTextDecoration (void ) o string ImagickDraw::getTextEncoding (void ) o public float ImagickDraw::getTextInterlineSpacing (void ) o public float ImagickDraw::getTextInterwordSpacing (void ) o public float ImagickDraw::getTextKerning (void ) o ImagickPixel ImagickDraw::getTextUnderColor (void ) o string ImagickDraw::getVectorGraphics (void ) o bool ImagickDraw::line (float $sx, float $sy, float $ex, float $ey) o bool ImagickDraw::matte (float $x, float $y, int $paintMethod) o bool ImagickDraw::pathClose (void ) o bool ImagickDraw::pathCurveToAbsolute (float $x1, float $y1, float $x2, float $y2, float $x, float $y) o bool ImagickDraw::pathCurveToQuadraticBezierAbsolute (float $x1, float $y1, float $x, float $y) o bool ImagickDraw::pathCurveToQuadraticBezierRelative (float $x1, float $y1, float $x, float $y) o bool ImagickDraw::pathCurveToQuadraticBezierSmoothAbsolute (float $x, float $y) o bool ImagickDraw::pathCurveToQuadraticBezierSmoothRelative (float $x, float $y) o bool ImagickDraw::pathCurveToRelative (float $x1, float $y1, float $x2, float $y2, float $x, float $y) o bool ImagickDraw::pathCurveToSmoothAbsolute (float $x2, float $y2, float $x, float $y) o bool ImagickDraw::pathCurveToSmoothRelative (float $x2, float $y2, float $x, float $y) o bool ImagickDraw::pathEllipticArcAbsolute (float $rx, float $ry, float $x_axis_rotation, bool $large_arc_flag, bool $sweep_flag, float $x, float $y) o bool ImagickDraw::pathEllipticArcRelative (float $rx, float $ry, float $x_axis_rotation, bool $large_arc_flag, bool $sweep_flag, float $x, float $y) o bool ImagickDraw::pathFinish (void ) o bool ImagickDraw::pathLineToAbsolute (float $x, float $y) o bool ImagickDraw::pathLineToHorizontalAbsolute (float $x) o bool ImagickDraw::pathLineToHorizontalRelative (float $x) o bool ImagickDraw::pathLineToRelative (float $x, float $y) o bool ImagickDraw::pathLineToVerticalAbsolute (float $y) o bool ImagickDraw::pathLineToVerticalRelative (float $y) o bool ImagickDraw::pathMoveToAbsolute (float $x, float $y) o bool ImagickDraw::pathMoveToRelative (float $x, float $y) o bool ImagickDraw::pathStart (void ) o bool ImagickDraw::point (float $x, float $y) o bool ImagickDraw::polygon (array $coordinates) o bool ImagickDraw::polyline (array $coordinates) o bool ImagickDraw::pop (void ) o bool ImagickDraw::popClipPath (void ) o bool ImagickDraw::popDefs (void ) o bool ImagickDraw::popPattern (void ) o bool ImagickDraw::push (void ) o bool ImagickDraw::pushClipPath (string $clip_mask_id) o bool ImagickDraw::pushDefs (void ) o bool ImagickDraw::pushPattern (string $pattern_id, float $x, float $y, float $width, float $height) o bool ImagickDraw::rectangle (float $x1, float $y1, float $x2, float $y2) o bool ImagickDraw::render (void ) o public void ImagickDraw::resetVectorGraphics (void ) o bool ImagickDraw::rotate (float $degrees) o bool ImagickDraw::roundRectangle (float $x1, float $y1, float $x2, float $y2, float $rx, float $ry) o bool ImagickDraw::scale (float $x, float $y) o bool ImagickDraw::setClipPath (string $clip_mask) o bool ImagickDraw::setClipRule (int $fill_rule) o bool ImagickDraw::setClipUnits (int $clip_units) o bool ImagickDraw::setFillAlpha (float $opacity) o bool ImagickDraw::setFillColor (ImagickPixel $fill_pixel) o bool ImagickDraw::setFillOpacity (float $fillOpacity) o bool ImagickDraw::setFillPatternURL (string $fill_url) o bool ImagickDraw::setFillRule (int $fill_rule) o bool ImagickDraw::setFont (string $font_name) o bool ImagickDraw::setFontFamily (string $font_family) o bool ImagickDraw::setFontSize (float $pointsize) o bool ImagickDraw::setFontStretch (int $fontStretch) o bool ImagickDraw::setFontStyle (int $style) o bool ImagickDraw::setFontWeight (int $font_weight) o bool ImagickDraw::setGravity (int $gravity) o public void ImagickDraw::setResolution (string $x_resolution, string $y_resolution) o bool ImagickDraw::setStrokeAlpha (float $opacity) o bool ImagickDraw::setStrokeAntialias (bool $stroke_antialias) o bool ImagickDraw::setStrokeColor (ImagickPixel $stroke_pixel) o bool ImagickDraw::setStrokeDashArray (array $dashArray) o bool ImagickDraw::setStrokeDashOffset (float $dash_offset) o bool ImagickDraw::setStrokeLineCap (int $linecap) o bool ImagickDraw::setStrokeLineJoin (int $linejoin) o bool ImagickDraw::setStrokeMiterLimit (int $miterlimit) o bool ImagickDraw::setStrokeOpacity (float $stroke_opacity) o bool ImagickDraw::setStrokePatternURL (string $stroke_url) o bool ImagickDraw::setStrokeWidth (float $stroke_width) o bool ImagickDraw::setTextAlignment (int $alignment) o bool ImagickDraw::setTextAntialias (bool $antiAlias) o bool ImagickDraw::setTextDecoration (int $decoration) o bool ImagickDraw::setTextEncoding (string $encoding) o public void ImagickDraw::setTextInterlineSpacing (float $spacing) o public void ImagickDraw::setTextInterwordSpacing (float $spacing) o public void ImagickDraw::setTextKerning (float $kerning) o bool ImagickDraw::setTextUnderColor (ImagickPixel $under_color) o bool ImagickDraw::setVectorGraphics (string $xml) o bool ImagickDraw::setViewbox (int $x1, int $y1, int $x2, int $y2) o bool ImagickDraw::skewX (float $degrees) o bool ImagickDraw::skewY (float $degrees) o bool ImagickDraw::translate (float $x, float $y) PHP Documentation Group IMAGICKDRAW(3)
All times are GMT -4. The time now is 08:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy