Sponsored Content
Full Discussion: viewing specific lines
Top Forums UNIX for Dummies Questions & Answers viewing specific lines Post 302074660 by vino on Thursday 25th of May 2006 03:25:29 AM
Old 05-25-2006
It is related to performance issues.

Say your file contains 1000 lines, and you need to view line 50. If you give sed -n "50p", then sed would read through the entire 1000 lines, which is a waste. In case of sed -n "51q;50p", sed would read 51 lines, and then print the 50th line.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to display specific lines of a specific file

are there any basic commands that can display lines 99 - 101 of the /etc/passwd file? I'm thinking use of head and tail, but I forget what numbers to use and where to put /etc/passwd in the command. (2 Replies)
Discussion started by: raidkridley
2 Replies

2. Shell Programming and Scripting

viewing lines

Hey, I know the head and tail function is to view like the top or bottom lines for each file. But lets say I want to view the top/bottom 100 or top/bottom 1000 for a file. whats the command that I use to do this? thanks (2 Replies)
Discussion started by: kylle345
2 Replies

3. Shell Programming and Scripting

substitute a string on a specific position for specific lines

I woud like to substitue a string on a specific position for specific lines I've got a file and I would like to change a specific string from "TOCHANGE" to "ABCABCAB" For every line (except 1,2, 3 and the last one) , I need to check between the 9th and the 16th digits. For the 3rd line, I... (7 Replies)
Discussion started by: BSF
7 Replies

4. Shell Programming and Scripting

Print Specific lines when found specific character

Hello all, I have thousand file input like this: file1: $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$ | | | |$$ $$ UERT | TTYH | TAFE | FRFG |$$ $$______|______|________|______|$$ $$ | | | |$$ $$ 1 | DISK | TR1311 | 1 |$$ $$ 1 |... (4 Replies)
Discussion started by: attila
4 Replies

5. UNIX for Dummies Questions & Answers

Quick UNIX command to display specific lines in the middle of a file from/to specific word

This could be a really dummy question. I have a log text file. What unix command to extract line from specific string to another specific string. Is it something similar to?: more +/"string" file_name Thanks (4 Replies)
Discussion started by: aku
4 Replies

6. UNIX for Dummies Questions & Answers

Printing lines with specific strings at specific columns

Hi I have a file which is tab-delimited. Now, I'd like to print the lines which have "chr6" string in both first and second columns. Could anybody help? (3 Replies)
Discussion started by: a_bahreini
3 Replies

7. Shell Programming and Scripting

ksh sed - Extract specific lines with mulitple occurance of interesting lines

Data file example I look for primary and * to isolate the interesting slot number. slot=`sed '/^primary$/,/\*/!d' filename | tail -1 | sed s'/*//' | awk '{print $1" "$2}'` Now I want to get the Touch line for only the associate slot number, in this case, because the asterisk... (2 Replies)
Discussion started by: popeye
2 Replies

8. Shell Programming and Scripting

Search and replace specific positions of specific lines

Hi, I have a file with hundreds of lines. I want to search for particular lines starting with 4000, search and replace the 137-139 position characters; which will be '000', with '036'. Can all of this be done without opening a temp file and then moving that temp file to the original file name. ... (7 Replies)
Discussion started by: dsid
7 Replies

9. UNIX for Beginners Questions & Answers

Viewing a specific timeframe of a log file

Hi guys Done a bit of research online but can't seem to figure it out, is there anyway of grepping or using sed to view a specific time period of a log file. I am trying to view a log file for Saturday 22nd April between 08:00 - 12:00 I saw this command online and tried but doesn't seem to... (10 Replies)
Discussion started by: simpsa27
10 Replies

10. UNIX for Beginners Questions & Answers

How to print lines from a files with specific start and end patterns and pick only the last lines?

Hi, I need to print lines which are matching with start pattern "SELECT" and END PATTERN ";" and only select the last "select" statement including the ";" . I have attached sample input file and the desired input should be as: INPUT FORMAT: SELECT ABCD, DEFGH, DFGHJ, JKLMN, AXCVB,... (5 Replies)
Discussion started by: nani2019
5 Replies
SoGLViewingMatrixElement(3)					       Coin					       SoGLViewingMatrixElement(3)

NAME
SoGLViewingMatrixElement - The SoGLViewingMatrixElement class is used to store the current viewing matrix. The viewing matrix contains the inverse camera coordinate system matrix. The camera coordinate system is built from the field values in the current SoCamera (currently either SoPerspectiveCamera or SoOrthographicCamera) and any transformations prior to the camera in the scene graph. SYNOPSIS
#include <Inventor/elements/SoGLViewingMatrixElement.h> Inherits SoViewingMatrixElement. Public Member Functions virtual void init (SoState *state) FIXME: write doc. virtual void push (SoState *state) virtual void pop (SoState *state, const SoElement *prevTopElement) Static Public Member Functions static SoType getClassTypeId (void) static int getClassStackIndex (void) static void * createInstance (void) static void initClass (void) static uint32_t getNodeId (SoState *const state) static SbMatrix getResetMatrix (SoState *state) Protected Member Functions virtual ~SoGLViewingMatrixElement () virtual void setElt (const SbMatrix &matrix) Additional Inherited Members Detailed Description The SoGLViewingMatrixElement class is used to store the current viewing matrix. The viewing matrix contains the inverse camera coordinate system matrix. The camera coordinate system is built from the field values in the current SoCamera (currently either SoPerspectiveCamera or SoOrthographicCamera) and any transformations prior to the camera in the scene graph. Constructor &; Destructor Documentation SoGLViewingMatrixElement::~SoGLViewingMatrixElement (void) [protected], [virtual] The destructor. Member Function Documentation SoType SoGLViewingMatrixElement::getClassTypeId (void) [static] This static method returns the class type. Reimplemented from SoViewingMatrixElement. int SoGLViewingMatrixElement::getClassStackIndex (void) [static] This static method returns the state stack index for the class. Reimplemented from SoViewingMatrixElement. void * SoGLViewingMatrixElement::createInstance (void) [static] This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. Reimplemented from SoViewingMatrixElement. void SoGLViewingMatrixElement::initClass (void) [static] This static method initializes static data for the SoViewingMatrixElement class. Reimplemented from SoViewingMatrixElement. void SoGLViewingMatrixElement::push (SoState *state) [virtual] This method is called every time a new element is required in one of the stacks. This happens when a writable element is requested, using SoState::getElement() or indirectly SoElement::getElement(), and the depth of the current element is less than the state depth. Override this method if your element needs to copy data from the previous top of stack. The push() method is called on the new element, and the previous element can be found using SoElement::getNextInStack(). Reimplemented from SoElement. void SoGLViewingMatrixElement::pop (SoState *state, const SoElement *prevTopElement) [virtual] This method is callled when the state is popped, and the depth of the element is bigger than the current state depth. pop() is called on the new top of stack, and a pointer to the previous top of stack is passed in prevTopElement. Override this method if you need to copy some state information from the previous top of stack. Reimplemented from SoElement. uint32_t SoGLViewingMatrixElement::getNodeId (SoState *conststate) [static] Returns the node id of the current camera node. This is used by SoGLModelMatrixElement to detect a change in the viewing matrix inside an SoTransformSeparator node. SbMatrix SoGLViewingMatrixElement::getResetMatrix (SoState *state) [static] Returns the matrix that should be used by SoGLModelMatrixElement when the transformation should be reset during traversal (typically when encountering an SoResetTransform node). It is not sufficient to simply load the viewing matrix, since the transformations that were applied before the camera needs to be accounted for. This function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API. Since: Coin 2.0 void SoGLViewingMatrixElement::setElt (const SbMatrix &matrix) [protected], [virtual] Sets the current viewing matrix. Reimplemented from SoViewingMatrixElement. Author Generated automatically by Doxygen for Coin from the source code. Version 3.1.3 Wed May 23 2012 SoGLViewingMatrixElement(3)
All times are GMT -4. The time now is 05:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy