Pattern extraction and usage by shell script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Pattern extraction and usage by shell script
# 1  
Old 11-15-2012
Pattern extraction and usage by shell script

Suppose im in a directory A. which has sub-directories x/y/z m/n/p etc. Iam only considered with those which have a file netl.oa at the lowermost level. So i used the find command which gives me a list in the form
Code:
./abc/def/ghi/jkl/netl.oa

and so on
Now i want the names abc def jkl and ghi. My script should goto abc directory and execute a file by giving command dbDump which executes the file dbDump.tdb. Now the contents of dbDump.tdb should be like this (Content of dbDump.tdb file)

Code:
Cellview name 'def' 'ghi' 'jkl'
End Cellview

How do i
1.extract def ghi jki from list
2.place def ghi jkl as shown above
3.save this file with the name dbDump.tdb
4.execute the command dbDump in each directory
I need to write some script for all this work
Guys im new to unix plz plz plz do help me

Last edited by Scrutinizer; 11-15-2012 at 02:06 AM.. Reason: code tags
# 2  
Old 11-15-2012
School work?
# 3  
Old 11-15-2012
totally new to shell scripting how do i open the file and extract the names using sed/awk?
# 4  
Old 11-15-2012
Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Script for extraction of pattern

Anyone can help here, with a script to extract the highlighted details from this two blocks?Actually there are milions of block, this is a sample? dn: EpsStaInfId=EpsStaInf,serv=EPS,mscId=aaaaaa001aaaaaaaa629100100138702,ou=multiSCs,dc=mtncg structuralObjectClass: EpsStaticInf objectClass:... (19 Replies)
Discussion started by: gillesi
19 Replies

2. UNIX for Beginners Questions & Answers

Extraction of data between parenthesis using multiple pattern

i want to extract all data with in parenthesis from a file by passing a pattern from another file.i have some sql statements in my file and i want to extract those ddl by refering to a pattern which is in another file and before writting into file i need some transformation to do.Basically i want... (1 Reply)
Discussion started by: raj121
1 Replies

3. Shell Programming and Scripting

sed and awk usage to grep a pattern 1 and with reference to this grep a pattern 2 and pattern 3

Hi , I have a file where i have modifed certain things compared to original file . The difference of the original file and modified file is as follows. # diff mir_lex.c.modified mir_lex.c.orig 3209c3209 < if(yy_current_buffer -> yy_is_our_buffer == 0) { --- >... (5 Replies)
Discussion started by: breezevinay
5 Replies

4. Shell Programming and Scripting

Shell script to calculate the max cpu usage from the main script

Hi All, I have a script which does report the cpu usuage, there are few output parameter/fields displayed from the script. My problem is I have monitor the output and decide which cpu number (column 2) has maximum value (column 6). Since the output is displayed/updated every seconds, it's very... (1 Reply)
Discussion started by: Optimus81
1 Replies

5. Shell Programming and Scripting

Pattern Search and Extraction Problem

I have something like this: bash-3.2$ svn info Path: . URL: svn+ssh://nlaedev01@10.209.194.15/files0/nlae_dev_svn/repos/newlook-endeca/trunk Repository Root: svn+ssh://nlaedev01@10.209.194.15/files0/nlae_dev_svn/repos/newlook-endeca Repository UUID: 4e8fbe85-c2e2-42fe-a5fa-f9f9100d2393... (3 Replies)
Discussion started by: ankur328
3 Replies

6. Shell Programming and Scripting

Need help to make a shell script with usage

Hello, I begin to write my first shell script, but I am totally lost, hope you can help me. I'd like to write a script with some conditions and multiples usages: ./myscript.sh -i <host> or ./myscript.sh -e <host> Have you some suggestion, because I am really lost, I try to do something... (12 Replies)
Discussion started by: Francesco
12 Replies

7. UNIX for Dummies Questions & Answers

Extraction of strings from a file, after pattern matching

I need to extract strings from a file. The file contains data like: Plan ABCD IN-+-172BB---118C2C---GGN_342-+-MM77_23--+-LAS24_3|GGK_774 | | \-LAS24_2|GGN_774 | +-AA_800_1-+-BAS_000|GGK_362 | | \-BAS_001|GGK_360 | \-DD_000T1---DAM_001|STEEL_0 Plan SHELL_1... (3 Replies)
Discussion started by: abkush
3 Replies

8. Infrastructure Monitoring

Shell Script Extraction

Hello Users, I am new to unix. I have a requirement to extract the string in the folder with files names XXXX.sev.xxxxx.lookup (There are some more files which I am not interested in like xxxxx.include.xxx.lookup). 1) I am looking for the file with the name "sev" ending with "lookup" ... (11 Replies)
Discussion started by: reachravi70
11 Replies

9. UNIX for Advanced & Expert Users

extraction of data from a text file which follows certain pattern

hi everybody, i have a file, in it I need to extract some data that follows a particular pattern.. For example: my file contains like now running Speak225 sep 22 mon 16:34:05 2008 -------------------------------- ... (4 Replies)
Discussion started by: mohkris
4 Replies

10. Shell Programming and Scripting

Shell script for text extraction from a file

Hi All, I am new to Shell Scripting. I have a file consisting of XML messages.Each message is associated with a timestamp value(it is not a xml field).I need to extract\copy all messages in a particular time interval and put in another new file using Shell Scripting. My XML looks like... (3 Replies)
Discussion started by: vignesh53
3 Replies
Login or Register to Ask a Question