Sponsored Content
Full Discussion: row separator with RS
Top Forums Shell Programming and Scripting row separator with RS Post 302695197 by mirni on Sunday 2nd of September 2012 01:12:49 AM
Old 09-02-2012
Quote:
i want to print row number 2 :
Quote:
if(NR==3)
This will print 3rd record, not 2nd, you realize that, right?

You can make it simpler:
Code:
awk 'NR==2' RS=###  infile

This User Gave Thanks to mirni For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Changing the column for a row in a text file and adding another row

Hi, I want to write a shell script which increments a particular column in a row from a text file and then adds another row below the current row with the incremented value . For Eg . if the input file has a row : abc xyz lmn 89 lm nk o p I would like the script to create something like... (9 Replies)
Discussion started by: aYankeeFan
9 Replies

2. UNIX for Dummies Questions & Answers

How to calculate the percentage/fraction of each value in a row against the maximum row value?

Hi, For each row in a file, i would like to identify the maximum value and calculate the percentage/fraction of the max for other values in the row. Then, I would like to print a copy of the file where values above a threshold are replaced with "1" and other values are left as "0". In the... (2 Replies)
Discussion started by: auburn
2 Replies

3. UNIX for Dummies Questions & Answers

Shell Script: Traverse Database Table Row by Row

Hello Everyone, My issue is that I want to traverse a database table row by row and do some action on the value retrieved in each row. I have gone through a lot of shell script questions/posts. I could find row by row traversal of a file but not a database table. Please help. Thanks &... (5 Replies)
Discussion started by: ahsan.asghar
5 Replies

4. Shell Programming and Scripting

Subtracting each row from the first row in a single column file using awk

Hi Friends, I have a single column data like below. 1 2 3 4 5 I need the output like below. 0 1 2 3 4 where each row (including first row) subtracting from first row and the result should print below like the way shown in output file. Thanks Sid (11 Replies)
Discussion started by: ks_reddy
11 Replies

5. Shell Programming and Scripting

Row separator

Hello All, I need help with the below, I would appreciate any tip. I have a file as below Input file Apple: Green Banana: Yellow Grapes: Black Apple: Red Banana: Green Grapes: Green Grapes: Brown Apple: Pale Red Banana: Greenish yellow Grapes: Brown Apple: Yellowish... (14 Replies)
Discussion started by: m6248m
14 Replies

6. Shell Programming and Scripting

Add Row from First Row (Split Row)

HI Guys, I have Below Input :- RepigA_hteis522 ReptCfiEtrBsCll_aofe MSL04_MSL2_A25_1A 0 9 MSL04_MSL2_A25_1B 0 9 MSL04_MSL2_A25_1C 0 9 RepigA ReptCfiEtrBsCll hteis522 aofe MSL04_MSL2_A25_1A 0 9 MSL04_MSL2_A25_1B 0 9 MSL04_MSL2_A25_1C 0 9 Split Data in two first row... (2 Replies)
Discussion started by: pareshkp
2 Replies

7. Shell Programming and Scripting

Create multiple files from single file based on row separator

Hello , Can anyone please help me to solve the below - Input.txt source table abc col1 char col2 number source table bcd col1 date col2 char output should be 2 files based on the row separator "source table" abc.txt col1 char (6 Replies)
Discussion started by: Pratik4891
6 Replies

8. UNIX for Beginners Questions & Answers

Keep only the closet match of timestamped row (include headers) from file1 to precede file2 row/s

My original files are like this below and I distinguish them from the AP_ID (file1 has 572 and file2 has 544). Also, the header on file1 has “G_” pre-pended. NOTE: these are only snippets of very large files and much of the data is not present here. Original File 1: ... (36 Replies)
Discussion started by: aachave1
36 Replies

9. Shell Programming and Scripting

Splitting single row into multiple rows based on for every 10 digits of last field of the row

Hi ALL, We have requirement in a file, i have multiple rows. Example below: Input file rows 01,1,102319,0,0,70,26,U,1,331,000000113200000011920000001212 01,1,102319,0,1,80,20,U,1,241,00000059420000006021 I need my output file should be as mentioned below. Last field should split for... (4 Replies)
Discussion started by: kotra
4 Replies

10. UNIX for Beginners Questions & Answers

Keep only the closet match of timestamped row (include headers) from file1 to precede file2 row/s

This is a question that is related to one I had last August when I was trying to sort/merge two files by millsecond time column (in this case column 6). The script (below) that helped me last august by RudiC solved the puzzle of sorting/merging two files by time, except it gets lost when the... (0 Replies)
Discussion started by: aachave1
0 Replies
DwtSeparator(3Dwt)														DwtSeparator(3Dwt)

Name
       DwtSeparator, DwtSeparatorCreate - Creates a separator widget for the application to define a border between items in a display.

Syntax
       Widget DwtSeparator(parent_widget, name, x, y, orientation)
	    Widget parent_widget;
	    char *name;
	    Position x, y;
	    unsigned char orientation;

       Widget DwtSeparatorCreate (parent_widget, name,
				  override_arglist, override_argcount)
	    Widget parent_widget;
	    char *name;
	    ArgList override_arglist;
	    int override_argcount;

Arguments
       parent_widget
		 Specifies the parent widget ID.

       name	 Specifies the name of the created widget.

       x	 Specifies  the  placement, in pixels, of the left side of the widget window relative to the inner upper left corner of the parent
		 window.  This argument sets the DwtNx core widget attribute.

       y	 Specifies, in pixels, the placement of the upper left corner of the widget window relative to the inner upper left corner of  the
		 parent window.  This argument sets the DwtNy core widget attribute.

       orientation
		 Specifies  whether  the  separator is displayed vertically or horizontally.  You can pass DwtOrientationHorizontal or DwtOrienta-
		 tionVertical.	This argument sets the DwtNorientation attribute associated with DwtSeparatorCreate.

		 A separator widget draws a centered single pixel line between the appropriate margins.  For example, a horizontal separator draws
		 a horizontal line from the left margin to the right margin.  It is placed vertically in the middle of the widget.

       override_arglist
		 Specifies the application override argument list.

       override_argcount
		 Specifies the number of attributes in the application override argument list (override_arglist).

Description
       The  DwtSeparator  and  DwtSeparatorCreate  functions create an instance of the separator widget and return its associated widget ID.  When
       calling DwtSeparator, you set the widget attributes presented in the formal parameter list.  For DwtSeparatorCreate, however, you specify a
       list of attribute name/value pairs that represent all the possible separator widget attributes.

       The  separator  widget is a screen object that allows the application to draw a separator between items in a display.  The separator widget
       draws horizontal or vertical lines in inactive areas of a window (typically menus).  Because a separator widget does not support  children,
       it always refuses geometry requests.  The separator widget does nothing on a resize by its parents.

Inherited Attributes
       ------------------------------------------------------------------
       Attribute Name	       Data Type	Default
       ------------------------------------------------------------------
       Core Attributes

       DwtNx		       Position 	Determined by the geome-
						try manager
       DwtNy		       Position 	Determined by the geome-
						try manager

       DwtNwidth	       Dimension	3 pixels
       DwtNheight	       Dimension	3 pixels
       DwtNborderWidth	       int		zero
       DwtNborder	       Pixel		Default foreground color
       DwtNborderPixmap        Pixmap		NULL
       DwtNbackground	       Pixel		Default background color
       DwtNbackgroundPixmap    Pixmap		NULL
       DwtNcolormap	       Colormap 	Default color map
       DwtNsensitive	       Boolean		True
       DwtNancestorSensitive   Boolean		The  bitwise  AND of the
						parent widget's DwtNsen-
						sitive	 and  DwtNances-
						torSensitive attributes
       DwtNaccelerators        XtTranslations	NULL
       DwtNdepth	       int		Depth of the parent win-
						dow
       DwtNtranslations        NOT SUPPORTED
       DwtNmappedWhenManaged   Boolean		True
       DwtNscreen	       Screen * 	The parent screen
       DwtNdestroyCallback     DwtCallbackPtr	NULL

       Common Attributes

       DwtNforeground	       Pixel		Default foreground color
       DwtNhighlight	       Pixel		Default foreground color
       DwtNhighlightPixmap     Pixmap		NULL
       DwtNuserData	       Opaque * 	NULL
       DwtNdirectionRToL       unsigned char	DwtDirectionRightDown
       DwtNfont 	       NOT SUPPORTED
       DwtNhelpCallback        NOT SUPPORTED

       Label Attributes

       DwtNlabelType	       unsigned char	DwtCString
       DwtNlabel	       DwtCompString	Widget name
       DwtNmarginWidth	       Dimension	Two pixels for text
						Zero pixels for pixmap
       DwtNmarginHeight        Dimension	Two pixels for text
						Zero pixels for pixmap
       DwtNalignment	       unsigned char	DwtAlignmentCenter
       DwtNpixmap	       Pixmap		NULL
       DwtNmarginLeft	       Dimension	Zero
       DwtNmarginRight	       Dimension	Zero
       DwtNmarginTop	       Dimension	Zero
       DwtNmarginBottom        Dimension	Zero
       DwtNconformToText       Boolean		True,  if  the widget is
						created with a width and
						height of zero
						False,	if the widget is
						created with a	non-zero
						width and height
       ------------------------------------------------------------------

Widget-Specific Attributes
       ------------------------------------------------------------
       Attribute Name	 Data Type	 Default
       ------------------------------------------------------------
       DwtNorientation	 unsigned char	 DwtOrientationHorizontal
       ------------------------------------------------------------

       DwtNorientation
		      Specifies whether the separator is displayed vertically or horizontally.	You can pass DwtOrientationHorizontal or DwtOrien-
		      tationVertical.  A separator widget draws a centered single pixel line between the appropriate margins.  For example, a hor-
		      izontal  separator  draws a horizontal line from the left margin to the right margin.  It is placed vertically in the middle
		      of the widget.

Return Values
       These functions return the ID of the created widget.

See Also
       Guide to the XUI Toolkit: C Language Binding
       Guide to the XUI Toolkit Intrinsics: C Language Binding

																DwtSeparator(3Dwt)
All times are GMT -4. The time now is 04:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy