Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Grep for X character on a word Post 54209 by jjoves on Thursday 5th of August 2004 10:15:16 AM
Old 08-05-2004
Grep for X character on a word

How can I grep for a certain letter that only shows on the 3rd letter or character.

ex:
ASGHDY
SHTYRD
SDTYRD
IGIKGD

I only want the TY part of the 3rd character
so output would only be SHTYRD and DDTYRD - I only want the TY on the 3rd character.

THANKS
 

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. Shell Programming and Scripting

Command to parse a word character by character

Hi All, Can anyone help me please, I have a word like below. 6,76 I want to read this word and check if it has "," (comma) and if yes then i want to replace it with "." (dot). That means i want to be changed to 6.76 If the word doesnot contain "," then its should not be changed. Eg. ... (6 Replies)
Discussion started by: girish.raos
6 Replies

4. Shell Programming and Scripting

Grep out specific word and only that word

ok, so this is proving to be kind of difficult even though it should not be. say for instance I want to grep out ONLY the word fkafal from the below output, how do I do it? echo ajfjf fjfjf iafjga fkafal foeref afoafahfia | grep -w "fkafal" If i run the above command, i get back all the... (4 Replies)
Discussion started by: SkySmart
4 Replies

5. Shell Programming and Scripting

How to grep a word and next column to that word?

Hi, I have input file as below. Can you help me? inac_4y;0;2;Balance;200;1;1; 0;2;Balance;100;1; 0;inac_nq;0;1;Balance;100;1 desired output Balance;200 Balance;100 Balance;100 -Suresh Please use and tags when posting code, data or logs etc. to preserve formatting... (5 Replies)
Discussion started by: suresh3566
5 Replies

6. Shell Programming and Scripting

grep part of word or Another word from a string

Hi all, FileOne family balance >>>>> 0 0 0 0 java.io.FileNotFoundException: Settings.xml (No such file or directory) at java.io.FileInputStream.open(Native Method) .. .... ..... ..... java.lang.NullPointerException ... ..... ...... Stacktrace: at... (2 Replies)
Discussion started by: linuxadmin
2 Replies

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

8. Shell Programming and Scripting

Grep the 5th and 6th position character of a word in a file

I am trying to find/grep the 5th and 6th position character (TX) of a word in a file. I tried to do grep "....TX" file The output gives me everything in the file with TX in it. I only need the output with the TX in the 5th and 6th position of the word. Any idea Example: test1 car... (5 Replies)
Discussion started by: e_mikey_2000
5 Replies

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

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
conv(3C)																  conv(3C)

NAME
toupper(), tolower(), _toupper(), _tolower(), toascii() - translate characters SYNOPSIS
DESCRIPTION
and have as domain the range of getc(3S): the integers from -1 through 255. If the argument of represents a lower-case letter, the result is the corresponding upper-case letter. If the argument of represents an upper-case letter, the result is the corresponding lower-case letter. All other arguments in the domain are returned unchanged. Arguments outside the domain cause undefined results. The macros and are identical to and respectively. yields its argument with all bits that are not part of a standard 7-bit ASCII character cleared; it is intended for compatibility with other systems. WARNINGS
is supplied both as a library function and as a macro defined in the header. Normally, the macro version is used. To obtain the library function, either use a to remove the macro definition or, if compiling in ANSI C mode, enclose the function name in parenthesis or take its address. The following examples use the library function for or The following example use the library function for EXTERNAL INFLUENCES
Locale The category determines the translations to be done. International Code Set Support Single-byte character code sets are supported. AUTHOR
was developed by IBM, OSF, and HP. SEE ALSO
ctype(3C), getc(3S), setlocale(3C), lang(5), thread_safety(5). STANDARDS CONFORMANCE
conv(3C)
All times are GMT -4. The time now is 09:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy