Extract from a file

Hi guys,

Thanks for this forum. It's been very helpful in improving my understanding of unix.

I have 2 questions.

a. eg I have the following

  big\_tom\_get_back\("final"\)  in a file, how can I use awk or sed to xtract the word "final" without the quote from the string.

 I try using cat tempfile|grep big\_tom_get |awk \`/\\\(\\" $1 \\"\\\)

This doesn't seem to work.

b. The second question is that I want to use the same command to loop through all the temp files stored in different location/directory. How can I do that? Does the find commnd work here?

I would appreciate any assistance on this

Thanks,

Odogbolu98:rolleyes:

Read the man page on awk and you will find the -F option - use it to change the field separator - set it to " and print $2 should give you what you want.

Read the man page on find - check out the exec option.

Can I have an example of that. It seems to me that " can't be used as a delimiter. what I mean is
eg. -F"\t" represents tab as a delimiter, when I use -F"\"" it gives unmatched ". message. Am I doing something wrong?

Thanks

Example (done in csh - should work with minor changes in other shells)

set junk='big_tom_get_back("final")'
echo $junk|awk -F\" '{print $2}'
final

Thanks, I really appreciate your help.

Regards,

Odogbolu98