Grep 9 string text


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Grep 9 string text
# 1  
Old 12-03-2012
Grep 9 string text

I have a file that have text like.

Code:
Download  	ABCD Edfdf x8634 4343 554545 (64bit) 	V33834-01 	1.4M
Download  	ABCD Edfdf x86 (64bit) 	V33855-01 	1.4M
Download  	ABCD Edfdf x8634 4343 5545 (64bit) 	V33834-01 	1.4M

i want text starts with V*-01 from above file.
# 2  
Old 12-03-2012
Code:
 
awk '{ for (i=1; i <=NF; i++) if(substr($i,1,1) == "V")  print $i }' file_name

Cheers,
This User Gave Thanks to Joseph_TKLee For This Post:
# 3  
Old 12-04-2012
if i have file that some text start with V* and i have similar file that have V*. If text is present in file1 but but not in file2 that display on screen.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Grep string in files and list file names that contain the string

Hi, I have a list of zipped files. I want to grep for a string in all files and get a list of file names that contain the string. But without unzipping them before that, more like using something like gzcat. My OS is: SunOS test 5.10 Generic_142900-13 sun4u sparc SUNW,SPARC-Enterprise (8 Replies)
Discussion started by: apenkov
8 Replies

2. Shell Programming and Scripting

grep exact string from files and write to filename when string present in file

I am attempting to grep an exact string from a series of files within a directory and append that output to the filename when it is present in the file. I've been after this all day with no luck. Thanks for your help in advance :wall:. (4 Replies)
Discussion started by: JC_1
4 Replies

3. Shell Programming and Scripting

Grep a string from input file and delete next three lines including the line contains string in xml

Hi, 1_strings file contains $ cat 1_strings /home/$USER/Src /home/Valid /home/Review$ cat myxml <projected value="some string" path="/home/$USER/Src"> <input 1/> <estimate value/> <somestring/> </projected> <few more lines > <projected value="some string" path="/home/$USER/check">... (4 Replies)
Discussion started by: greet_sed
4 Replies

4. Shell Programming and Scripting

Search text file, then grep next instance of string

I need to be able to search for a beginning line header, then use grep or something else to get the very next instance of a particular string, which will ALWAYS be in "Line5". What I have is some data that appears like this: Line1 Line2 Line3 Line4 Line5 Line6 Line7 Line1 Line2 ...... (4 Replies)
Discussion started by: Akilleez
4 Replies

5. Shell Programming and Scripting

Grep for a string and then grep using a string from that result

Hello, Thanks in advance for the query. There is a log file abcd.log which has multible line like this. "hello1" , "hello2", "hello3" , "hello4" , "hello5" I want to grep for the lines which has "hello4" & "hello5" and use "hello2" to grep the same log file again. All these should... (8 Replies)
Discussion started by: kzenthil
8 Replies

6. Shell Programming and Scripting

Print lines between two lines after grep for a text string

I have several very large file that are extracts from Oracle tables. These files are formatted in XML type syntax with multiple entries like: <ROW> some information more information </ROW> I want to grep for some words, then print all lines between <ROW> AND </ROW>. Can this be done with AWK?... (7 Replies)
Discussion started by: jbruce
7 Replies

7. UNIX for Dummies Questions & Answers

| help | unix | grep - Can I use grep to return a string with exactly n matches?

Hello, I looking to use grep to return a string with exactly n matches. I'm building off this: ls -aLl /bin | grep '^.\{9\}x' | tr -s ' ' -rwxr-xr-x 1 root root 632816 Nov 25 2008 vi -rwxr-xr-x 1 root root 632816 Nov 25 2008 view -rwxr-xr-x 1 root root 16008 May 25 2008... (7 Replies)
Discussion started by: MykC
7 Replies

8. UNIX for Dummies Questions & Answers

Copy or Grep all text below a string

Hello, I am trying to copy all the text from a file below a search string... For example i want to grep all text below the word sure: UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! ... (2 Replies)
Discussion started by: aliaa2a
2 Replies

9. Shell Programming and Scripting

grep a string from 2 text files

How to grep a string in two different files, I am having the following scenario TextFile1 Date (dd/mm)Time Server IP Error Code =========================================================================== 10/04/2008 10:10 ServerA xxx.xxx.xxx.xxx ... (15 Replies)
Discussion started by: karthikn7974
15 Replies

10. Shell Programming and Scripting

Appending to filename a string of text grep finds

I am wanting to automate a process that includes the step of appending to a filename a string of text that's contained inside the file. I.e. if filename A.fileA contains a string of text that reads 1234 after the phrase ABC, I want the shell script file to rename the file 1234_FileChecked_A.fileA.... (3 Replies)
Discussion started by: HLee1981
3 Replies
Login or Register to Ask a Question