Sponsored Content
Top Forums Shell Programming and Scripting Help with print out line that have different record in specific column Post 302889773 by perl_beginner on Sunday 23rd of February 2014 10:40:53 PM
Old 02-23-2014
Help with print out line that have different record in specific column

Input file 1:
Code:
-       7367    8198
-       8225    9383
+       9570    10353

Input file 2:
Code:
-       2917    3667
-       3851    4250
+       4517    6302
+       6302    6740
+       6768    7524
+       7648    8170
+       8272    8896
+       8908    9915
-       10010   10796
-       10788   11514
+       11588   12533
+       12545   13874

Input file 3:
Code:
+       56      1190
+       1199    2606
-       2698    3337

Desired Output file 1:
Code:
-       8225    9383
+       9570    10353

Desired Output file 2:
Code:
-       3851    4250
+       4517    6302
+       8908    9915
-       10010   10796
-       10788   11514
+       11588   12533

Desired Output file 3:
Code:
+       1199    2606
-       2698    3337

I would like only print out the line that start change from "+" to "-" or "-" to "+".
Situation in Input file 2, is a bit more challenge.
I have no much idea about how to solve it out Smilie
Thanks for any advice.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Question about sort specific column and print other column at the same time !

Hi, This is my input file: ali 5 usa abc abu 4 uk bca alan 6 brazil bac pinky 10 utah sdc My desired output: pinky 10 utah sdc alan 6 brazil bac ali 5 usa abc abu 4 uk bca Based on the column two, I want to do the descending order and print out other related column at the... (3 Replies)
Discussion started by: patrick87
3 Replies

2. Shell Programming and Scripting

print first few lines, then apply regex on a specific column to print results.

abc.dat tty cpu tin tout us sy wt id 0 0 7 3 19 71 extended device statistics r/s w/s kr/s kw/s wait actv wsvc_t asvc_t %w %b device 0.0 133.2 0.0 682.9 0.0 1.0 0.0 7.2 0 79 c1t0d0 0.2 180.4 0.1 5471.2 3.0 2.8 16.4 15.6 15 52 aaaaaa1-xx I want to skip first 5 line... (4 Replies)
Discussion started by: kchinnam
4 Replies

3. Shell Programming and Scripting

Print first and last line from multiline record

Hi - I'm new to working with multiline records and I'm going nuts trying to do something that seems simple. Input: Tue May 1 14:00 Header Record 1 is valid. Tue May 1 14:00 processing data to 25-Mar-2012 09:00:23.15 Tue May 1 14:03 Header Record 1 is valid. Tue May 1 14:03 processing data... (4 Replies)
Discussion started by: Catullus
4 Replies

4. Shell Programming and Scripting

awk to print record not equal specific pattern

how to use "awk" to print any record has pattern not equal ? for example my file has 5 records & I need to get all lines which $1=10 or 20 , $2=10 or 20 and $3 greater than "130302" as it shown : 10 20 1303252348212B030 20 10 1303242348212B030 40 34 1303252348212B030 10 20 ... (14 Replies)
Discussion started by: arm
14 Replies

5. Shell Programming and Scripting

Execution problem with print out record that follow specific pattern

Hi, Do anybody know how to print out only those record that column 1 is "a" , then followed by "b"? Input file : a comp92 2404242 2405172 b comp92 2405303 2406323 b comp92 2408786 2410278 a comp92 2410271 2410337 a comp87 1239833 1240418 b comp87... (3 Replies)
Discussion started by: patrick87
3 Replies

6. Shell Programming and Scripting

Problem to print out record got smallest number in specific column

Hi, Anybody know how to print out the record that shown smallest number among column 3 and column 4 Case 1 Input : 37170 37196 77 51 37174 37195 73 52 37174 37194 73 53 Case 1 Output : 37170 37196 77 51 Case 2 Input : 469613 469660 73 ... (4 Replies)
Discussion started by: cpp_beginner
4 Replies

7. Shell Programming and Scripting

Problem facing to compare different column and print out record with smallest number

Hi, Input file 1 : 37170 37196 77 51 37174 37195 73 52 37174 37194 73 53 Desired Output file 1 : 37170 37196 77 51 Input file 2 : 37174 37195 73 0 37170 37196 77 0 Desired Output file 2 : 37174 37195 73 0 (1 Reply)
Discussion started by: cpp_beginner
1 Replies

8. Shell Programming and Scripting

How to print multiple specific column after a specific word?

Hello.... Pls help me (and sorry my english) :) So I have a file (test.txt) with 1 long line.... for example: isgc jsfh udgf osff 8462 error iwzr 653 idchisfb isfbisfb sihfjfeb isfhsi gcz eifh How to print after the "error" word the 2nd 4th 5th and 7th word?? output well be: 653 isfbisfb... (2 Replies)
Discussion started by: marvinandco
2 Replies

9. Shell Programming and Scripting

Help with print out record if first and next line follow specific pattern

Input file: pattern1 100 250 US pattern2 50 3050 UK pattern3 100 250 US pattern1 70 1050 UK pattern1 170 450 Mal pattern2 40 750 UK . . Desired Output file: pattern1 100 250 US pattern2 50 3050 UK pattern1 170 450 Mal pattern2... (3 Replies)
Discussion started by: cpp_beginner
3 Replies

10. Shell Programming and Scripting

Overwrite specific column in xml file with the specific column from adjacent line

I have an xml file dumped from rrd file, that I want to "patch" so the xml file doesn't contain any blank hole in the resulting graph of the rrd file. Here is the file. <!-- 2015-10-12 14:00:00 WIB / 1444633200 --> <row><v> 4.0419731265e+07 </v><v> 4.5045912770e+06... (2 Replies)
Discussion started by: rk4k
2 Replies
Tk_GeometryRequest(3)					       Tk Library Procedures					     Tk_GeometryRequest(3)

__________________________________________________________________________________________________________________________________________________

NAME
Tk_GeometryRequest, Tk_SetMinimumRequestSize, Tk_SetInternalBorder, Tk_SetInternalBorderEx - specify desired geometry or internal border for a window SYNOPSIS
#include <tk.h> Tk_GeometryRequest(tkwin, reqWidth, reqHeight) Tk_SetMinimumRequestSize(tkwin, minWidth, minHeight) Tk_SetInternalBorder(tkwin, width) Tk_SetInternalBorderEx(tkwin, left, right, top, bottom) ARGUMENTS
Tk_Window tkwin (in) Window for which geometry is being requested. int reqWidth (in) Desired width for tkwin, in pixel units. int reqHeight (in) Desired height for tkwin, in pixel units. int minWidth (in) Desired minimum requested width for tkwin, in pixel units. int minHeight (in) Desired minimum requested height for tkwin, in pixel units. int width (in) Space to leave for internal border for tkwin, in pixel units. int left (in) Space to leave for left side of internal border for tkwin, in pixel units. int right (in) Space to leave for right side of internal border for tkwin, in pixel units. int top (in) Space to leave for top side of internal border for tkwin, in pixel units. int bottom (in) Space to leave for bottom side of internal border for tkwin, in pixel units. _________________________________________________________________ DESCRIPTION
Tk_GeometryRequest is called by widget code to indicate its preference for the dimensions of a particular window. The arguments to Tk_GeometryRequest are made available to the geometry manager for the window, which then decides on the actual geometry for the window. Although geometry managers generally try to satisfy requests made to Tk_GeometryRequest, there is no guarantee that this will always be possible. Widget code should not assume that a geometry request will be satisfied until it receives a ConfigureNotify event indicating that the geometry change has occurred. Widget code should never call procedures like Tk_ResizeWindow directly. Instead, it should invoke Tk_GeometryRequest and leave the final geometry decisions to the geometry manager. If tkwin is a top-level window, then the geometry information will be passed to the window manager using the standard ICCCM protocol. Tk_SetInternalBorder is called by widget code to indicate that the widget has an internal border. This means that the widget draws a deco- rative border inside the window instead of using the standard X borders, which are external to the window's area. For example, internal borders are used to draw 3-D effects. Width specifies the width of the border in pixels. Geometry managers will use this information to avoid placing any children of tkwin overlapping the outermost width pixels of tkwin's area. Tk_SetInternalBorderEx works like Tk_SetInternalBorder but lets you specify different widths for different sides of the window. Tk_SetMinimumRequestSize is called by widget code to indicate that a geometry manager should request at least this size for the widget. This allows a widget to have some control over its size when a propagating geometry manager is used inside it. The information specified in calls to Tk_GeometryRequest, Tk_SetMinimumRequestSize, Tk_SetInternalBorder and Tk_SetInternalBorderEx can be retrieved using the macros Tk_ReqWidth, Tk_ReqHeight, Tk_MinReqWidth, Tk_MinReqHeight, Tk_MinReqWidth, Tk_InternalBorderLeft, Tk_Internal- BorderRight, Tk_InternalBorderTop and Tk_InternalBorderBottom. See the Tk_WindowId manual entry for details. KEYWORDS
geometry, request Tk 8.4 Tk_GeometryRequest(3)
All times are GMT -4. The time now is 10:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy