sed delete wildcard within a string


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting sed delete wildcard within a string
# 1  
Old 11-20-2010
sed delete wildcard within a string

Hi

I would like to batch delete the "note" entry from bib files. The start would be defined by "note ={" and the end by "}." (see example bib entry below).

I tried the following command which does not have any effect:

Code:
cat input.bib| sed -e 's/note = {.*}.//' > output.bib

Any help would be appreciated!


Code:
@ARTICLE{Yoshioka2003,
  author = {Yoshioka, K. and Foletta, V. and Bernard, O. and Itoh, K.},
  title = {A role for LIM kinase in cancer invasion},
  journal = {Proc Natl Acad Sci U S A},
  year = {2003},
  volume = {100},
  pages = {7247-52},
  number = {12},
  note = {Yoshioka, Kiyoko Foletta, Victoria Bernard, Ora Itoh, Kazuyuki Research
    Support, Non-U.S. Gov't United States Proceedings of the National
    Academy of Sciences of the United States of America Proc Natl Acad
    Sci U S A. 2003 Jun 10;100(12):7247-52. Epub 2003 May 30.},
  abstract = {In this study, we show that LIM kinase 1 (LIMK1), a critical regulator
    of actin dynamics, plays a regulatory role in tumor cell invasion.
    We found that the level and activity of endogenous LIMK1 is increased
    in invasive breast and prostate cancer cell lines in comparison with
    less invasive cells. Overexpression of LIMK1 in MCF-7 and in MDA-MB-231
    human breast cancer cell lines increased their motility, whereas
    the specific ROCK and Rho inhibitors Y-27632 and C3, respectively,
    attenuated this effect. In addition, inhibition of LIMK1 activity
    in the MDA-MB-231 cells by expression of dominant-negative LIMK1
    resulted in decreased motility and formation of osteolytic bone lesions
    in an animal model of tumor invasion. This study shows an important
    role for LIMK1 signaling in invasion of cancer, demonstrating its
    potential as a therapeutic molecular target to decrease metastasis.},
  keywords = {Animals Bone Neoplasms/enzymology/genetics/secondary Breast Neoplasms/enzymology/genetics/pathology
    Female Gene Expression Humans Lim Kinases Male Mice Mice, Nude Mutation
    Neoplasm Invasiveness/*physiopathology Neoplasm Transplantation Osteolysis/enzymology/etiology/pathology
    Prostatic Neoplasms/enzymology/genetics/pathology Protein Kinase
    Inhibitors Protein Kinases/genetics/*physiology Signal Transduction
    Transfection Transplantation, Heterologous Tumor Cells, Cultured}
}

Moderator's Comments:
Mod Comment
Please use code tags when posting data and code samples!

Last edited by vgersh99; 11-20-2010 at 02:11 PM.. Reason: code tags, please!
# 2  
Old 11-20-2010
Try:
Code:
sed '/note =/,/}/d' input.bib > output.bib

This User Gave Thanks to Scrutinizer For This Post:
# 3  
Old 11-20-2010
Thanks! Works!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Delete string between 3rd tab and first pattern with SED

Hello, I have this sentence :Pattern1 Pattern2 Pattern3 Pattern4-which-contains-HELLO-string-and-other-stuff-and-second-HELLO-and-third-HELLO I want to delete everything between the 3rd tab (\t) and the FIRST pattern "HELLO" of the line. Result expected is : Pattern1 ... (7 Replies)
Discussion started by: theclem35
7 Replies

2. Shell Programming and Scripting

SED help delete characters in a string

Hi Please help me to refine my syntax. I want to delete the excess characters from the out put below. -bash-3.00$ top -b -n2 -d 00.20 |grep Cpu|tail -1 | awk -F ":" '{ print $2 }' | cut -d, -f1 4.4% us now i want to delete the % and us. How wil i do that to make it just 4.4. Thanks (7 Replies)
Discussion started by: redtred
7 Replies

3. UNIX for Dummies Questions & Answers

Delete string between delimiters with sed

Hi, I need to delete all text between "|" delimiters. The line in text file typically looks like this: 1014182| 13728 -rw-r--r-- 1 imac1 staff 7026127 2 okt 2010 |/Users/imac1/Music/iTunes/iTunes Media/Music/Various Artists/We Are the World_ U.S.A. for Africa/01 We Are the World.mp3... (2 Replies)
Discussion started by: andrejm
2 Replies

4. Shell Programming and Scripting

SED delete string from till problems

Hi i have a file which contains 2 lines, line 1 is static data. line 2 is a very large string(over 3000char or much more). in that string are tags which i want to delete. e.g. <order1>123</order1><tag1>data</tag1><new>1</new><order2>124</order2><tag1>data</tag1> all one one line. now i... (5 Replies)
Discussion started by: subby80
5 Replies

5. Shell Programming and Scripting

sed to delete lines from a file by using wildcard

I have a text file with tons of data and I want to remove all lines which are have "240" regardless of ABC or BCD and shouldnt delete anything else ABC_10_00024045.zip blah blah ABC_10_00024045.zip.new ABC_10_00024046.zip blah blah ABC_10_00024046.zip.new ABC_10_00024446.zip blah blah... (3 Replies)
Discussion started by: gubbu
3 Replies

6. Shell Programming and Scripting

delete multiline string from file using sed.

Hi, I have file which has the following content... GOOD MORNING **********WARNING********** when it kicks from the kickstart, sshd daemon should start at last. (WHEN KICKING ITSELF, NOT AFTER KICKING). /etc/rc3.d/S55sshd ( run level specification for sshd is 55, now I would want to... (4 Replies)
Discussion started by: skmdu
4 Replies

7. Shell Programming and Scripting

use sed do batch wildcard string replace

Hi, Here is what I want to do I want to search local directory and its sub directory, all the files which contain any string like _12345, then remove this string. String is a combination of _ plus a random integer number. For example, here is one line in a file before <properties... (1 Reply)
Discussion started by: bp5000
1 Replies

8. Shell Programming and Scripting

how to cut string with wildcard (sed)

i got text file and contain.... SKYPE Dec 11 09:26:05 IN=eth0 OUT=eth1 SRC=75.38.161.80 DST=192.168.1.56 PROTO=UDP SPT=30645 DPT=12630 LEN=66 SKYPE Dec 11 09:26:05 IN=eth1 OUT=eth0 SRC=192.168.1.56 DST=118.109.39.86 PROTO=UDP SPT=12630 DPT=15889 LEN=75 SKYPE Dec 11 09:26:05 IN=eth1 OUT=eth0... (2 Replies)
Discussion started by: slackman
2 Replies

9. Shell Programming and Scripting

Using sed to delete string between delimiters

Hi There! I have the following string which i need to convert to i.e. between each occurence of the delimiter ('|' in this case), i need to delete all characters from the '|' to the ':' so that |10,9:12/xxx| becomes |12/xxx| How can i do this using sed? Thanks in advance! (13 Replies)
Discussion started by: orno
13 Replies

10. UNIX for Dummies Questions & Answers

Using sed to delete a string?

Hi all! Here is my problem : I have a string like the following : 20030613170404;BAN_CAV ; starting script Loader.sh on ; 13/06/2003 at ; 17;04;03 I want to eraze all characters located after "Loader.sh", because there are unuseful. I tried to use sed...but it didnt work....i guess i... (1 Reply)
Discussion started by: HowardIsHigh
1 Replies
Login or Register to Ask a Question