To filter a certain pattern depending on neighbour


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting To filter a certain pattern depending on neighbour
# 1  
Old 02-09-2009
To filter a certain pattern depending on neighbour

Hi, As I am new to filtering section of Unix I am facing a problem
I have following lines in text file :
Created RELEASE in dist/Apple_release_1_0_.zip
Created RELEASE in dist/Banana_release_1_0_.zip
Created RELEASE in dist/Mango_release_1_0_.zip
Created RELEASE in dist/Cucumber_release_1_0.zip

Which filter should I use to have the following output?

/Apple
/Banana
/Mango
/Cucumber

Any idea please suggest. Thank you
# 2  
Old 02-09-2009
Code:
perl -lne'print m|(/[^/_]*)|' infile

# 3  
Old 02-09-2009
many many thans radoulov..its working
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Filter pattern in grep command

Hi, I am having a file like below hello how are you hello... (5 Replies)
Discussion started by: rohit_shinez
5 Replies

2. Shell Programming and Scripting

sed -- Find pattern -- print remainder -- plus lines up to pattern -- Minus pattern

The intended result should be : PDF converters 'empty line' gpdftext and pdftotext?xml version="1.0"?> xml:space="preserve"><note-content version="0.1" xmlns:/tomboy/link" xmlns:size="http://beatniksoftware.com/tomboy/size">PDF converters gpdftext and pdftotext</note-content>... (9 Replies)
Discussion started by: Klasform
9 Replies

3. Shell Programming and Scripting

sed - filter blocks between single delimiters matching a pattern

Hi! I have a file with the following format:CDR ... MSISDN=111 ... CDR ... MSISDN=xxx ... CDR ... MSISDN=xxx ... CDR ... MSISDN=111 (2 Replies)
Discussion started by: Flavius
2 Replies

4. Shell Programming and Scripting

Need help in a script to filter specific pattern

Hello , Below is the command srvctl config database -d cmdbut -s boms10.world Below is the output. Now in the command instead of cmdbut it will be a variable like $database which would be called in the script as below: srvctl config database -d $database -s $service Now,as shown in... (6 Replies)
Discussion started by: Vishal_dba
6 Replies

5. Shell Programming and Scripting

Change nth depending on matiching a pattern in Y line

Hi, I have below file, each line that starts with /* marks the beginning of the a new job. /* ----------------- cmdsMlyMoveTPMPLANTJ ----------------- UNIX_JOB CMMM002J CMDNAME /home2/proddata/bin/moveTPMPLANT.sh AGENT CMDSHP USER proddata AFTER CMMU001J /* "DDRG monthly... (13 Replies)
Discussion started by: varun22486
13 Replies

6. Shell Programming and Scripting

Add depending on the column

Hi all, If column 6 is negative then I want column 3 is be subtracted by 150. If column 6 is positive then I want 150 added to the value at column 2. The file that looks like this: Bull 38 158 HWI-ST600:206:D0L90ACXX:8:2214:15503:17988 0 -... (2 Replies)
Discussion started by: phil_heath
2 Replies

7. UNIX for Dummies Questions & Answers

Filter file according to pattern

Hello I have an input file which is tab delimited.In my unix script I have search for a particular pattern.If it is NOT present then I have to write in an output file. Eg.Input file is : 123 hello 7779 hi hkjh88 hahah 678 hello 90845 ti hkjsdfh 9324 And the search string is "123... (2 Replies)
Discussion started by: akashtcs
2 Replies

8. Shell Programming and Scripting

Urgent! Sed/Awk Filter Find Pattern Delete Till End Of Line

Hi, I need help with using an awk or sed filter on the below line ALTER TABLE "ACCOUNT" ADD CONSTRAINT "ACCOUNT_PK" PRIMARY KEY ("ACCT_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1) TABLESPACE "WMC_DATA" LOGGING ENABLE Look for... (2 Replies)
Discussion started by: rajan_san
2 Replies

9. Shell Programming and Scripting

cut subsrting from string depending on pattern

Dears, i'm glad to be a member of this big UNIXer's group :( ,hoping to be one of'm. my question: how i get the subsrting ahmad "from" the string ".ahmad." for example ?? Thank you all. (5 Replies)
Discussion started by: Muslem_it
5 Replies

10. UNIX for Dummies Questions & Answers

Do commands depending on the comparision

Dear all, I am writing a shell, that do commands if the file count reaches 96. I wrote a shell, but doesn't work #!/bin/sh MIN_FILE_COUNT=96; GET_PATH=/home/collection/data1; export GET_PATH FILES_COUNT=`ls $dirname | wc -l` if then echo "commands listed here" fi test.sh:... (4 Replies)
Discussion started by: mr_bold
4 Replies
Login or Register to Ask a Question