Sponsored Content
Top Forums Shell Programming and Scripting grep part of word or Another word from a string Post 302525982 by linuxadmin on Monday 30th of May 2011 01:25:24 AM
Old 05-30-2011
thanks.. its working fine.

Thanks Mr. Scrutinizer
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to grep for a word and display only the word

Hi, When we "grep" for a word in a file, it returns the lines containing the word that we searched for. Is there a way to display only the words and not the entire line containing them. Thanks Ananth (6 Replies)
Discussion started by: ananthmm
6 Replies

2. UNIX for Dummies Questions & Answers

how to grep the word and display only the second word from it

hi, consider the below line in a text file, 'Y',getdate(),'N','V',NULL ..... 'N',getdate(),'Y','D',NULL ..... 'Y','N','Y',getdate(),'Y','D',NULL .... as u see above, i want only the second word after the getdate() word... getdate() will not come 2nd word alwys it may be any position but i... (11 Replies)
Discussion started by: prsam
11 Replies

3. UNIX for Dummies Questions & Answers

Seach for part of string and replace whole word

I am trying to find words in a text with a certain ending with sed and replace them with themselves but wrapped in tabs ex.: The fish swims in the water. -> searching for -ms ending The fish <tab>swims<tab>in the water. I've been trying all sorts of commands and get either an error... (5 Replies)
Discussion started by: stinnes
5 Replies

4. Shell Programming and Scripting

Replace a word in a string starting with another word

Hi All, I have a file in which a number of lines are starting with similar first word but different next words. I want to replace the any nth word(not 1st or 2nd) with another word. Eg:- My file contains are like this:- Ram is a boy. Ram is a good boy. Ram plays cricket. Here I want to... (2 Replies)
Discussion started by: mukeshbaranwal
2 Replies

5. Shell Programming and Scripting

How ti Grep for a word and print the next word

Hi can we grep for a word and print the next word of the greped word? ex:- create or replace function function_name create function function_name we should search for word "function" and output next word "function_name" from both lines. (3 Replies)
Discussion started by: manasa_vs
3 Replies

6. UNIX for Dummies Questions & Answers

Find EXACT word in files, just the word: no prefix, no suffix, no 'similar', just the word

I have a file that has the words I want to find in other files (but lets say I just want to find my words in a single file). Those words are IDs, so if my word is ZZZ4, outputs like aaZZZ4, ZZZ4bb, aaZZZ4bb, ZZ4, ZZZ, ZyZ4, ZZZ4.8 (or anything like that) WON'T BE USEFUL. I need the whole word... (6 Replies)
Discussion started by: chicchan
6 Replies

7. UNIX for Dummies Questions & Answers

How to grep the exact string / word ?

Hi All, I have a text / log file which contains strings like meta777, 77, meta, 777. Now I want to write a script which can detect a string 'meta#777' in a text file & number of occurence of 'meta', number of #, number 7, 77, 777. I'm using grep -e '77' filename but no luck. It is returning... (5 Replies)
Discussion started by: adc22
5 Replies

8. Shell Programming and Scripting

Need a word which just comes next to after grep of a specific word

Hi, Below is an example : ST1 PREF: int1 AVAIL: int2 ST2 PREF :int1 AVAIL: int2 I need int1 to come in preferred variable while programming and int2 in available variable Please help me doing so Best regards, Vishal (10 Replies)
Discussion started by: Vishal_dba
10 Replies

9. 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

10. Shell Programming and Scripting

Grep for a word or word with underscore

I have a file "test" with following contents: cat test abc abcd_efg abc_abc I want to only grep for abc or abc_ without getting other results, how do I achieve this? If I use grep -w abc test option I get only abc and not abc_. If I use egrep "abc|abc_" test its still printing... (3 Replies)
Discussion started by: ctrld
3 Replies
DtEditorFormat(library call)											      DtEditorFormat(library call)

NAME
DtEditorFormat -- format all or part of the contents of a DtEditor widget SYNOPSIS
#include <Dt/Editor.h> DtEditorErrorCode DtEditorFormat( Widget widget, DtEditorFormatSettings *formatSettings, unsigned int amountToFormat); DESCRIPTION
The DtEditorFormat function formats all or part of the contents of the DtEditor widget according to the current text format settings in the Format Settings dialog. These options specify which margins and alignments (left aligned, right aligned, justified or centered) are used. Optionally, alternative settings can be passed as an argument to DtEditorFormat in a data structure. This function formats either the paragraph containing the insertion cursor or the entire contents of the DtEditor widget, depending on the value of the amountToFormat argu- ment. The Format Settings dialog is displayed with DtEditorInvokeFormatDialog(3). For a complete description of formatting and the Format Set- tings dialog, see DtEditor. The widget argument specifies the editor widget ID. The formatSettings argument specifies left margin value, right margin value and the justification style. The LeftMargin and RightMargin fields of DtEditorFormatSettings must be zero or larger. The Alignment field can have a value of DtEDITOR_ALIGN_CENTER, DtEDI- TOR_ALIGN_JUSTIFY, DtEDITOR_ALIGN_LEFT or DtEDITOR_ALIGN_RIGHT. If the formatSettings argument is NULL, DtEditorFormat uses the last format settings specified in the Format Settings dialog. When the amountToFormat argument is set to DtEDITOR_FORMAT_ALL, it reformats all the text in the edit window. When this argument is set to DtEDITOR_PARAGRAPH, only the paragraph containing the insertion cursor is formatted. For a complete definition of the DtEditor widget and its associated resources, see DtEditor(3). For a complete definition of DtEditorFormatSettings, see Dt/Editor.h - DtEditor(5). RETURN VALUE
Upon successful completion, the DtEditorFormat function returns DtEDITOR_NO_ERRORS; otherwise, it returns one of the following values: DtEDITOR_NO_TMP_FILE The DtEditorFormat function cannot create two temporary files in the directory returned by tmpnam3S. DtEDITOR_ILLEGAL_SIZE The left or right margin values are negative. DtEDITOR_INVALID_RANGE The amountToFormat argument is not recognized. DtEDITOR_INVALID_TYPE The Alignment field is not recognized. SEE ALSO
Dt/Editor.h - DtEditor(5), DtEditor(3), DtEditorInvokeFormatDialog(3); tmpnam3S. DtEditorFormat(library call)
All times are GMT -4. The time now is 12:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy