Sponsored Content
Top Forums UNIX for Dummies Questions & Answers To print the 1st column using sed Post 302537364 by win4luv on Friday 8th of July 2011 01:52:42 AM
Old 07-08-2011
you are simply aweseomeSmilie....Also lets say, if i need to pull 3 & 4 or any random selection of the columns how do i go abt doing it? Also can you please suggest some good unix books
appreciate your help.
win4luv
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Strings from one file which exactly match to the 1st column of other file and then print lines.

Hi, I have two files. 1st file has 1 column (huge file containing ~19200000 lines) and 2nd file has 2 columns (small file containing ~6000 lines). ################################# huge_file.txt a a ab b ################################## small_file.txt a 1.5 b 2.5 ab ... (4 Replies)
Discussion started by: AshwaniSharma09
4 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

sed/awk to update 1st column if condition met

Hi, I am trying to update the 1st column of a file but only if it contains a char here is an example of my file 1111aaa 9999 textaaa 22222bbb 9999 textbbb 3333 9999 textccc 444ddd 9999 textddd i would like the output to remove any characters () from... (5 Replies)
Discussion started by: plennon
5 Replies

4. Shell Programming and Scripting

Using sed on 1st column of tab delimited file

Hi all, I'm new to Unix and work primarily in bioinformatics. I am in need of a script which will allow me to replace "1" with "chr1" in only the first column of a file which looks like such: 1 10327 rs112750067 T C . PASS ASP;RSPOS=10327;... (4 Replies)
Discussion started by: Hkins552
4 Replies

5. Shell Programming and Scripting

AWK/SED print if 2nd character in a column is greater than 0

We have an access log where column 8 displays the time in seconds like below: Tj8nQAoNgwsAABov9cIAAAFL - 10.13.131.80 - - (0) - "GET /aaaaa/bbbb/bbbb where column 8 is printed (0). We are trying to find how many entries are there that has column 8 greater than 0. Remember $8 is (0) and not... (5 Replies)
Discussion started by: spacemtn5
5 Replies

6. Shell Programming and Scripting

comparing column of two different files and print the column from in order of 2nd file

Hi friends, My file is like: Second file is : I need to print the rows present in file one, but in order present in second file....I used while read gh;do awk ' $1=="' $gh'" {print >> FILENAME"output"} ' cat listoffirstfile done < secondfile but the output I am... (14 Replies)
Discussion started by: CAch
14 Replies

7. Shell Programming and Scripting

awk Print New Column For Every Two Lines and Match On Multiple Column Values to print another column

Hi, My input files is like this axis1 0 1 10 axis2 0 1 5 axis1 1 2 -4 axis2 2 3 -3 axis1 3 4 5 axis2 3 4 -1 axis1 4 5 -6 axis2 4 5 1 Now, these are my following tasks 1. Print a first column for every two rows that has the same value followed by a string. 2. Match on the... (3 Replies)
Discussion started by: jacobs.smith
3 Replies

8. Linux

Print the 1st column and the value in 2nd or 3rd column if that is different from the values in 1st

I have file that looks like this, DIP-17571N|refseq:NP_651151 DIP-17460N|refseq:NP_511165|uniprotkb:P45890 DIP-17571N|refseq:NP_651151 DIP-19241N|refseq:NP_524261 DIP-19241N|refseq:NP_524261 DIP-17151N|refseq:NP_524316|uniprotkb:O16797 DIP-19588N|refseq:NP_731165 ... (2 Replies)
Discussion started by: Syeda Sumayya
2 Replies

9. UNIX for Beginners Questions & Answers

Compare 1st column from 2 file and if match print line from 1st file and append column 7 from 2nd

hi I have 2 file with more than 10 columns for both 1st file apple,0,0,0...... orange,1,2,3..... mango,2,4,5..... 2nd file apple,2,3,4,5,6,7... orange,2,3,4,5,6,8... watermerlon,2,3,4,5,6,abc... mango,5,6,7,4,6,def.... (1 Reply)
Discussion started by: tententen
1 Replies

10. UNIX for Beginners Questions & Answers

Need to print nth till last column of ls output using sed

I wish to print first, third and sixth till the last column from the output of ls command ls -ltr /app/deploy.yml -rw-rw-r-- 1 user1 dba 27342 Aug 28 10:17 /app/deploy.yml Desired Output: Below command gives me the desired output. ls -ltr /app/deploy.yml | awk '{$2=$4=$5=""; print... (6 Replies)
Discussion started by: mohtashims
6 Replies
dxbook(1X)																dxbook(1X)

Name
       dxbook - Bookreader

Syntax
       dxbook [ options ] [ file ]

Arguments
       file	 Specifies a bookshelf file.  If you do not include this argument, Bookreader uses the file specified by the environment variable.
		 If is not defined, Bookreader uses the default bookshelf file,

Description
       The command runs Bookreader.  Bookreader lets you view online documentation on your workstation screen.

       Bookreader has two windows:  the selection window and the topic window.	The selection window lists the	bookshelves  and  books  available
       from  Bookreader,  and  the  table  of  contents or index when a book is open.  The topic window displays the contents of the book you have
       selected to view.

       A bookshelf is a group of related books.  To view a book that is in a shelf, you must first open the shelf by double-clicking  MB1  on  the
       shelf title.  When you open a shelf, a list of the books and bookshelves in that shelf appears in the selection window.

       When you open a book by double-clicking MB1 on the book title, the table of contents for that book appears in the selection window, and the
       title page for the book appears in the topic window.

       You can move through a book's contents in the topic window using the scroll bar and the Next Topic, Previous Topic, Go Back, and More  but-
       tons.

       In the topic window, a reference in the text to a figure, a table, or an example is a hotspot.  That is, if you position the pointer at the
       reference and click MB1, the figure, table, or example is displayed in a separate window.  A figure, table, or example  may  also  be  dis-
       played by selecting it from the book's table of contents in the selection window.

       Cross-references  to  other sections of text are also hotspots.	Clicking on a reference to another section causes the new topic to be dis-
       played in the topic window.

       Hotspots are normally highlighted only when you move the pointer over the reference.  You can cause hotspots to be continuously highlighted
       by choosing the Hot Spot menu item from the topic window View menu.

       Clicking MB1 on the Index button located at the bottom of the selection window displays the book's index; clicking MB1 on the Contents but-
       ton displays the table of contents.  Double-clicking MB1 on an item in the book's table of contents or index displays the referenced  topic
       in the topic window.  Use the scroll bar in the selection window to move quickly through the book's table of contents or index.

       Every  command  button  has  an	equivalent menu item in the Control or View menu of the selection or topic window; therefore, you can also
       choose a selection or navigation function by selecting the appropriate menu item.

Options
       -bg color	   Specifies the color of the selection window's background (color displays only).  The default is white.

       -d dispname	   Specifies the display screen on which displays its windows.	If the display option is not specified, uses  the  display
			   screen  specified  by  the  environment variable.  The display option has the format hostname:number.  Using two colons
			   (::) instead of one (:) causes DECnet to be used for transport.  The default is :0.	For more information, see

       -display dispname   This option is the same as the -d option.

       -fg color	   Specifies the color of Bookreader windows' foreground (color displays only).  The default is black.

       -geometry	   Specifies the width, length, and location of the selection window.  If the geometry argument  is  not  specified,  uses
			   default  values.   The  geometry option has the format =[width][xlength][x][y], where width and length are specified in
			   pixels.  Note that changing the width or length of the selection window may make the contents of the  window  difficult
			   to read.  For more information about the screen coordinate system, see

       -rv		   Reverses the default color values (for example, black becomes white and white becomes black).

Menus
       Many  of the items in the Control and View menus of the selection and topic windows have equivalent command buttons, located along the bot-
       tom edge of the selection and topic windows.  You can select a function using the menu item or the equivalent command button.

Selection Window
       The Bookreader selection window contains the following menus:
       Control
       View

   Control Menu
       The Control menu in the selection window allows you to open and close shelves and books, and exit the Bookreader application.  The  Control
       menu contains the following menu items:

       Open Shelf	   Opens the bookshelf you have selected.  The titles of the books in the bookshelf are displayed in the selection window.

       Open Book	   Opens the book you have selected.  The title page of the book is displayed in the topic window, and the book's table of
			   contents is displayed in the selection window.

       Close Shelf	   Closes the bookshelf currently displayed in the selection window.

       Close Book	   Closes the book currently displayed in the topic window.

       Quit		   Exits from the Bookreader application and closes all windows.

   View Menu
       The View menu in the selection window allows you to select what Bookreader displays in the selection window.  The View  menu  contains  the
       following menu items:

       Library		   Displays  the  top-level list of shelves and books that can be viewed online, and closes an open book in the topic win-
			   dow.

       Table of Contents   Displays the table of contents for the book that is currently open.

       Index		   Displays the index for the book that is currently open.

       Tables		   Displays a list of the tables in the book that is currently open.

       Figures		   Displays a list of the figures in the book that is currently open.

       Examples 	   Displays a list of the examples in the book that is currently open.

       Topic		   Displays the selected topic in the topic window.

Topic Window
       The Bookreader topic window contains the following menus:
       Control
       View

   Control Menu
       The Control menu in the topic window allows you to control the topic window.  The Control menu contains the following menu item:

       Close Topic	   Closes the topic window.

   View Menu
       The View menu in the topic window allows you to select what Bookreader displays in the topic window.  The View menu contains the  following
       menu items:

       Previous Topic	   Displays the previous topic in the book.

       Next Topic	   Displays the next topic in the book.

       Go Back		   Displays the topic you were viewing just prior to the current topic.

       More		   Displays the next window of text in the current topic.  If the end of the current topic is visible in the topic window,
			   the next topic is opened.

       Hot Spots	   Enables and disables highlighting of hotspots, which are references to figures, tables, examples, footnotes,  or  other
			   sections of text.  By default, hotspots are not highlighted.

       Extensions	   Enables  and disables highlighting of programming language extensions.  By default, extensions to programming languages
			   are highlighted in the topic window.

X Defaults
       The application reads the file during startup and uses the appropriate resource specification to customize the appearance  or  characteris-
       tics of its displayed window.  The format for a resource specification in the file is:

       [name*]resource:  value

       name	 Specifies the application name or the name string that restricts the resource assignment to that application or to a component of
		 an application.  If this argument is not specified, the resource assignment is globally available to all X applications.

       resource  Specifies the resource.

       value	 Specifies the value that is to be assigned to the resource.

       For more information, see

       Because each toolkit-based application can consist of a combination of widgets (for example, push buttons and a scroll bar), you  can  form
       the  name  string  by  adding widget class and name identifiers to the string.  For further information about adding class and name identi-
       fiers, see

       For the application class identifier is DXBookreader.

       For the application name identifier is dxbook.

       The resources available for are:

       background	   Specifies the selection window background color.  The default is white.

       foreground	   Specifies the selection and topic window foreground color.  The default is black.

       initialState	   Specifies whether Bookreader starts up with the selection window displayed, or starts up as an icon.  Setting the  ini-
			   tial state to 3 causes Bookreader to start up as an icon.

   Examples
       To change the foreground color of the Bookreader windows, add the following entry to your file:
       dxbook*foreground:  yellow
       To cause Bookreader to start up as an icon, add this entry to your file:
       DXBookreader.initialState: 3

Specifying Libraries
       When  you first run Bookreader, the list of bookshelves and books that appears in the selection window is the top-level library.  A special
       file called the bookshelf file contains an entry for each bookshelf and book that appears in the top-level library.  You  can  specify  the
       bookshelf  file	explicitly,  using  the  file  argument on the command line.  If the file argument is not included, or does not contain an
       explicit pathname specification, Bookreader uses the environment variables and to locate the bookshelf file.

       DECW_BOOK	   Specifies the search path for book and bookshelf files.  Separate multiple pathnames with spaces.  If is not set and no
			   explicit pathname is specified on the command line, Bookreader looks for book and bookshelf files in

       DECW_BOOKSHELF	   Specifies  the  bookshelf  file.   If  is not set and the file argument is not included on the command line, Bookreader
			   looks for a bookshelf file named

			   If is not set, but is, Bookreader looks for bookshelf files named using the search path specified by

       The environment variables allow you to have Bookreader recognize additional books or bookshelf files.  You can store  bookshelf	files  and
       their  associated book files in different directories, and set the environment variable to specify all the pathnames. For example, you have
       the default bookshelf and books in and another bookshelf with its books in You set to specify both pathnames:
       setenv DECW_BOOK "/usr/lib/dxbook /usr/local/lib/localbooks"

       and all titles appear in the selection window when you run Bookreader.

Files
       Bookreader binary

       Default bookshelf

See Also
       Using Bookreader 	     Available online in the default bookshelf

																	dxbook(1X)
All times are GMT -4. The time now is 09:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy