extract data from a find string


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting extract data from a find string
# 1  
Old 05-13-2002
extract data from a find string

Can any one please lend a helping hand here?
eg. find /tough -name temp1 -print

After finding the location of all temp1 files. I need to extract some data( some are multiple others are just one entry) from each of the temp file.

eg Order_Error{"aaaa")
Order_Error("bbba")
Order_Error("ccccc")

I used the command

grep Order_Error|awk -F\" '{print $2}'

My concern is how do apply this command along with the find command.

Thanks in advance,

Odogbolu98
Smilie Smilie
# 2  
Old 05-14-2002
Pipe the find into the grep & use xargs, you also need to use the -h option on grep to supress the filenames

find /tough -name temp1 -print|xargs grep -h Order_Error|awk -F\" '{print $2}'
# 3  
Old 05-15-2002
Code:
find /tough -name temp1 -print -exec awk -F\" '/OrderError/{print $2}' {} \;

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

to extract string from main string and string comparison

continuing from my previous post, whose link is given below as a reference https://www.unix.com/shell-programming-scripting/171076-shell-scripting.html#post302573569 consider there is create table commands in a file for eg: CREATE TABLE `Blahblahblah` ( `id` int(11) NOT NULL... (2 Replies)
Discussion started by: vivek d r
2 Replies

2. Shell Programming and Scripting

find string(s) in text file and nearby data, export to list help

Hi, So I'm kinda new to shell scripts and the like. I've picked up quite a bit of use from browsing the forums here but ran into a new one that I can't seem to find an answer for. I'm looking to parse/find a string AND the next 15 or so charachters that follow the string within a text file... (1 Reply)
Discussion started by: kar23me
1 Replies

3. Shell Programming and Scripting

Find replace a particular string of data with wildcard

Hi I am having a csv file in which lots of data are available wherein i need to find a particular kind of data and replace it with null value. here is the sample data.. I need to find the string starting with 404-064- and up to the first space i have to remove the data and keep the... (4 Replies)
Discussion started by: aemunathan
4 Replies

4. Shell Programming and Scripting

Extract specific data content from a long list of data

My input: Data name: ABC001 Data length: 1000 Detail info Data Direction Start_time End_time Length 1 forward 10 100 90 1 forward 15 200 185 2 reverse 50 500 450 Data name: XFG110 Data length: 100 Detail info Data Direction Start_time End_time Length 1 forward 50 100 50 ... (11 Replies)
Discussion started by: patrick87
11 Replies

5. Shell Programming and Scripting

Extract data based on match against one column data from a long list data

My input file: data_5 Ali 422 2.00E-45 102/253 140/253 24 data_3 Abu 202 60.00E-45 12/23 140/23 28 data_1 Ahmad 256 7.00E-45 120/235 140/235 22 data_4 Aman 365 8.00E-45 15/65 140/65 20 data_10 Jones 869 9.00E-45 65/253 140/253 18... (12 Replies)
Discussion started by: patrick87
12 Replies

6. Shell Programming and Scripting

Find a string and extract a value from a file

I have a file where a line has the following form: n0=7.00 !Central density and I want to extract the value 7.00. I used to do this with the order below, which finds the string "n0" and take the rest of the line parting from the separator "=", but the comment "Central density..."... (7 Replies)
Discussion started by: josegr
7 Replies

7. Shell Programming and Scripting

extract data from a data matrix with filter criteria

Here is what old matrix look like, IDs X1 X2 Y1 Y2 10914061 -0.364613333 -0.362922333 0.001691 -0.450094667 10855062 0.845956333 0.860396667 0.014440333 1.483899333... (7 Replies)
Discussion started by: ssshen
7 Replies

8. Shell Programming and Scripting

Extract data from a string

Hi all, I want to extract "this_data" from the string below using awk <Bundle_Name>this_data</Bundle_Name> Any help would be appreciated (5 Replies)
Discussion started by: cillmor
5 Replies

9. Shell Programming and Scripting

Anyways to find sentences with data format and extract it???

Hi guys,i got this problem which is..i need to find those sentences with date inside and extract them out,the input is somehow like this eg: $DATA42.GANTRY2.GA161147 DISKFILE 2007-10-16 11:56:45 SUPER.OPR \NETS.$Y4CB.#IN ... (4 Replies)
Discussion started by: cyberray
4 Replies

10. Shell Programming and Scripting

Find term and extract till end of data

Hi All, I have an awk code below. How can i edit it such that once it finds the term "start" , it will extract all the rest of data thereafter ? awk '/start/, /stop/' file (4 Replies)
Discussion started by: Raynon
4 Replies
Login or Register to Ask a Question