Sponsored Content
Top Forums UNIX for Dummies Questions & Answers search for a word and it's occurance at the output Post 302191965 by legendofanatoli on Monday 5th of May 2008 04:52:50 PM
Old 05-05-2008
thx a lot my friend
it's working
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

String search - Command to find second occurance

Hi, I am new to Unix world. Is there any command which can directly return the second occurance of a particular string in a file? Basically, I want to read the contents of the file from the second occurance of a particualr string. Can be implemented using a loop, but am just wondering if there... (5 Replies)
Discussion started by: saurabhsinha23
5 Replies

2. Shell Programming and Scripting

search and replace the last occurance of a match in a file

HI please let me know if there is any command to search and replace only the last occurence of a string in aline. Eg: " This cat is a cat with a tail longer of all cat." I need to replace only the last "cat" in the above line. thanks (3 Replies)
Discussion started by: harikris614
3 Replies

3. Shell Programming and Scripting

How to find frequent occurance of a word in a line?

File_source.DAT 1|abc|abc|abc|abc|abc 2|abc|abc|efg|efg|def 3|abc|bcd|cde|def|efg 4|abc|abc|abc|def|efg ========================= Please help me to solve this as below using UNIX. ========================= File_output.DAT "1"|"abc" - as... (3 Replies)
Discussion started by: scpyraj
3 Replies

4. Shell Programming and Scripting

Search and replace only the first occurance

Hi, I need to search a string and replace with nothing, but only the First occurring string using sed/perl/awk (3 Replies)
Discussion started by: suraj.sheikh
3 Replies

5. Shell Programming and Scripting

word search in output

How to get the fisrt word of the output of a shell script . below command will display the list of baselines in my view . cmd : cleartool lsstream -fmt "%NXp\n" -view $VIEW_NAME Output : baseline:MHC_BUILDTREE1.0.1 baseline:JEPG_DUIF_CI baseline:MOR_BuildTree_BLD_I.0.1 I need to... (2 Replies)
Discussion started by: saku
2 Replies

6. Shell Programming and Scripting

Search for the word and exporting 35 characters after that word using shell script?

I have a file input.txt which have loads of weird characters, html tags and useful materials. I want to display 35 characters after the word description excluding weird characters like $$#$#@$#@***$# and without html tags in the new file output.txt. Help me. Thanx in advance. My final goal is to... (11 Replies)
Discussion started by: sachit adhikari
11 Replies

7. Shell Programming and Scripting

Grep word after last occurance of string and display next few lines

Hi, I wanted to grep string "ERROR" and "WORNING" after last occurrence of String "Starting" only and wanted to display two lines after searched ERROR and WORNING string and one line before. I have following cronjob log file "errorlog" file and I have written the code for same in Unix as below... (17 Replies)
Discussion started by: nes
17 Replies

8. Shell Programming and Scripting

Search for a word in file and output to another

Hello Experts! I am trying to perform a common task, searching data from within a file and placing what is found into another.However, I have not been able to figure the “How to” with this situation. I need to search through all lines within this text and pull the first positional attributes... (5 Replies)
Discussion started by: leepet
5 Replies

9. Shell Programming and Scripting

Help search and replace the last occurance of match in a file

Hi I want to replace only the last occurance of "union all" in input file with ";" I tried with sed 's/union all/;/g' in my input file, it replaced in all lines of input file Eg: select column1,column2 from test1 group by 2 union all select column1,column2 from test2 group by 2 union all ... (9 Replies)
Discussion started by: antosr7
9 Replies

10. UNIX for Beginners Questions & Answers

How to search for a word in column header that fully matches the word not partially in awk?

I have a multicolumn text file with header in the first row like this The headers are stored in an array called . which contains I want to search for each elements of this array from that multicolumn text file. And I am using this awk approach for ii in ${hdr} do gawk -vcol="$ii" -F... (1 Reply)
Discussion started by: Atta
1 Replies
SbString(3)							       Coin							       SbString(3)

NAME
SbString - The SbString class is a string class with convenience functions for string operations. This is the class used for storing and working with character strings. It automatically takes care of supporting all the 'bookkeeping' tasks usually associated with working with character strings, like memory allocation and deallocation etc. SYNOPSIS
#include <Inventor/SbString.h> Public Member Functions SbString (void) SbString (const char *s) SbString (const char *s, int start, int end) SbString (const SbString &s) SbString (const int digits) ~SbString () uint32_t hash (void) const int getLength (void) const void makeEmpty (SbBool freeold=TRUE) const char * getString (void) const SbString getSubString (int startidx, int endidx=-1) const void deleteSubString (int startidx, int endidx=-1) void addIntString (const int value) char operator[] (int index) const SbString & operator= (const char *s) SbString & operator= (const SbString &s) SbString & operator+= (const char *s) SbString & operator+= (const SbString &s) SbString & operator+= (const char c) int operator! (void) const int compareSubString (const char *text, int offset=0) const SbString & sprintf (const char *formatstr,...) SbString & vsprintf (const char *formatstr, va_list args) void apply (char(*func)(char input)) int find (const SbString &s) const SbBool findAll (const SbString &s, SbIntList &found) const SbString lower () const SbString upper () const Static Public Member Functions static uint32_t hash (const char *s) Friends int operator== (const SbString &sbstr, const char *s) int operator== (const char *s, const SbString &sbstr) int operator== (const SbString &str1, const SbString &str2) int operator!= (const SbString &sbstr, const char *s) int operator!= (const char *s, const SbString &sbstr) int operator!= (const SbString &str1, const SbString &str2) const SbString operator+ (const SbString &str1, const SbString &str2) const SbString operator+ (const SbString &sbstr, const char *s) const SbString operator+ (const char *s, const SbString &sbstr) Detailed Description The SbString class is a string class with convenience functions for string operations. This is the class used for storing and working with character strings. It automatically takes care of supporting all the 'bookkeeping' tasks usually associated with working with character strings, like memory allocation and deallocation etc. This class should also be well suited for use by the application programmer throughout the application using the Coin library. See also: SbName Constructor &; Destructor Documentation SbString::SbString (void) [inline] This is the default constructor. It initializes the string to be empty. SbString::SbString (const char *str) [inline] This constructor assigns from the given string. SbString::SbString (const char *str, intstart, intend) [inline] This constructor constructs a string from the given substring from start to end indices inclusive. If end is -1, the substring from start until the end of the string is used. SbString::SbString (const SbString &str) [inline] This is the copy constructor. SbString::SbString (const intdigits) [inline] Construct an SbString instance containing the digits of the integer argument. SbString::~SbString () [inline] The destructor. Deallocates any internal resources used during the lifetime of the SbString instance. Member Function Documentation uint32_t SbString::hash (void) const [inline] This method returns a reasonable hash value for the current string. See also: uint32_t SbString::hash(const char * s) uint32_t SbString::hash (const char *s) [inline], [static] This static method returns a hash value for the given string. int SbString::getLength (void) const [inline] This method returns the length of the string. void SbString::makeEmpty (SbBoolfreeold = TRUE) [inline] This method clears the string, making it an empty string (''). If freeold is TRUE (which is the default), the memory used by the old string is freed. Otherwise, memory will be kept and reused when the string is manipulated later. const char * SbString::getString (void) const [inline] This method returns the pointer to the string (character array). SbString SbString::getSubString (intstartidx, intendidx = -1) const [inline] This method returns a new string which contains a substring defined by the given indices startidx and endidx (inclusive). If endidx is -1, the substring from startidx to the end of the string is used. This will return a string which is (endidx - startidx + 1) characters long, i.e. if this string is 'foo/bar' and we call by SbString::getSubString(0, 3), the returned string will be 'foo/'. void SbString::deleteSubString (intstartidx, intendidx = -1) [inline] This method deletes the substring defined by startidx and endidx (inclusive). If endidx is -1, the substring from startidx to the end of the string is deleted. void SbString::addIntString (const intvalue) [inline] Constructs a string from the given integer (e.g. intToString(42) creates the string '42'), and adds this to the contents of the string. char SbString::operator[] (intindex) const [inline] Returns character at position index in the string. See also: getSubString() SbString & SbString::operator= (const char *str) [inline] This is the assignment operator. SbString & SbString::operator= (const SbString &str) [inline] Assign from the given string. SbString & SbString::operator+= (const char *str) [inline] Concatenate the given string to the end of the current one. SbString & SbString::operator+= (const SbString &str) [inline] Concatenate the given string to the end of the current one. SbString & SbString::operator+= (const charc) [inline] Concatenate the given character to the end of the current string. Note: This member function is not compatible with OpenInventor. int SbString::operator! (void) const [inline] This unary operator results in TRUE if the current string is empty ('') or FALSE otherwise. int SbString::compareSubString (const char *text, intoffset = 0) const [inline] Uses text as a substring to be compared to the string, starting at offset offset. Return value is 0 upon success, and the failing character comparison difference upon failure. SbString & SbString::sprintf (const char *formatstr, ...) [inline] Set SbString instance to the formatted string formatstr, replacing the current contents. The control characters within formatstr and the remaining arguments should follow the conventions of the printf() call. Note that this function is not part of the original Open Inventor API. SbString & SbString::vsprintf (const char *formatstr, va_listargs) [inline] Set SbString instance to the formatted string formatstr, replacing the current contents. The control characters within formatstr and the arguments of the args argument list should follow the conventions of the printf() call. Note that this function is not part of the original Open Inventor API. int SbString::find (const SbString &strarg) const If s is found, the method returns the first index where s starts. Otherwise it returns -1. Note: SbString::find() is a Coin specific extension to the original Open Inventor API. See also: SbString::findAll() Since: Coin 2.0 SbBool SbString::findAll (const SbString &strarg, SbIntList &found) const All occurences of str is represented in found as indices to the characters where str starts. If 1 or more is found, TRUE is returned, else FALSE is returned. Note: SbString::findAll() is an extension to the original Open Inventor API. See also: SbString::find() Since: Coin 2.0 SbString SbString::lower () const Converts all of the characters to lowercase using tolower(). Since: Coin 3.1 SbString SbString::upper () const Converts all of the characters to uppercase using toupper(). Since: Coin 3.1 Friends And Related Function Documentation int operator== (const SbString &str, const char *s) [friend] Equality operator. Check if the strings have the same contents. int operator== (const char *s, const SbString &str) [friend] Equality operator. Check if the strings have the same contents. int operator== (const SbString &str1, const SbString &str2) [friend] Equality operator. Check if the strings have the same contents. int operator!= (const SbString &str, const char *s) [friend] Inequality operator. int operator!= (const char *s, const SbString &str) [friend] Inequality operator. int operator!= (const SbString &str1, const SbString &str2) [friend] Inequality operator. const SbString operator+ (const SbString &str1, const SbString &str2) [friend] Addition operator. const SbString operator+ (const SbString &sbstr, const char *s) [friend] Addition operator. const SbString operator+ (const char *s, const SbString &sbstr) [friend] Addition operator. Author Generated automatically by Doxygen for Coin from the source code. Version 3.1.3 Wed May 23 2012 SbString(3)
All times are GMT -4. The time now is 06:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy