Today I also used Sed to do some relatively complex job. So I used regular expression. However, the expression in Sed is a little bit different from normal Regexp, especially the "(". There is no need to write it as "\(", the solely "(" is OK!

#!/bin/bash
cd /Volumes/Macintosh_HD_2/Research/RData/R_Packages/TCGA_EDRN_Gene_Mining/R/
for file in *.R;
do
echo $file
sed -ig 's/EDRN_CNV_Gene_Eset.rda/CNV_Eset.rda/g' $file
sed -ig 's/EDRN_TvN_ExpressionData.rda/Expression_TvN_EDRN.rda/g' $file
sed -ig 's/EDRN_TvN_MethylationData_CC_SuhSample_BGcor.rda/Methylation_TvN_TCGA.rda/g' $file
sed -ig 's/Expression_CellLine_Match_Ade.rda/Expression_CellLine_EDRN.rda/g' $file
sed -ig 's/TCGA_Exp_Match.rda/Expression_TvN_TCGA.rda/g' $file
sed -ig 's/TCGA_Meth_Match_NARM.rda/Methylation_TvN_TCGA.rda/g' $file
sed -ig "s/load(\'\.\/Data\//data(/g" $file
sed -ig "s/\.rda\')/)/g" $file
done

Sed Regular Expression的更多相关文章

  1. [LeetCode] Regular Expression Matching 正则表达式匹配

    Implement regular expression matching with support for '.' and '*'. '.' Matches any single character ...

  2. myeclipse中导入js报如下错误Syntax error on token "Invalid Regular Expression Options", no accurate correc

    今天在使用bootstrap的时候引入的js文件出现错误Syntax error on token "Invalid Regular Expression Options", no ...

  3. [LeetCode] 10. Regular Expression Matching

    Implement regular expression matching with support for '.' and '*'. DP: public class Solution { publ ...

  4. No.010:Regular Expression Matching

    问题: Implement regular expression matching with support for '.' and '*'.'.' Matches any single charac ...

  5. Regular Expression Matching

    Implement regular expression matching with support for '.' and '*'. '.' Matches any single character ...

  6. 【leetcode】Regular Expression Matching

    Regular Expression Matching Implement regular expression matching with support for '.' and '*'. '.' ...

  7. 【leetcode】Regular Expression Matching (hard) ★

    Implement regular expression matching with support for '.' and '*'. '.' Matches any single character ...

  8. grep(Global Regular Expression Print)

    .grep -iwr --color 'hellp' /home/weblogic/demo 或者 grep -iw --color 'hellp' /home/weblogic/demo/* (-i ...

  9. 66. Regular Expression Matching

    Regular Expression Matching Implement regular expression matching with support for '.' and '*'. '.' ...

随机推荐

  1. js控制html文字提示语的出现和隐藏

    有时我们需要在点击html输入框的时候,旁边会出现提示语.在输入字符的时候,输入框下边会出现输入了多少字符的提示. 请看下面实例. <!DOCTYPE html> <html> ...

  2. C# 正则表达式 验证:数字、带小数点数字、电话和手机

    一.带小数点数字 public static bool IsNumber(string input) { string pattern = "^-?\\d+$|^(-?\\d+)(\\.\\ ...

  3. Oracle连接出现TNS:no listener或者ORA-12514: TNS:listener does not currently know

    1.Message 850 not found; No message file for product=network, facility=NL 提示框:TNS:no listener 解决办法: ...

  4. CSS引入外部字体

    @font-face {    font-family: '综艺体';    font-style: normal;    font-weight: normal;    src: url(../cs ...

  5. jpcap

    1.System.out.println( System.getProperty("java.library.path")); 2.将jpcap.dll放到上边打印的路径中

  6. JAVA之关于This的用法

    JAVA之关于This的用法   业精于勤,荒于嬉:行成于思,毁于随.——韩愈 用类名定义一个变量的时候,定义的应该只是一个引用,外面可以通过这个引用来访问这个类里面的属性和方法,那们类里面是够也应该 ...

  7. self.view 的不当操作造成死循环

    如题,在创建ContentView的时候,例子如下 NSString *viewClassName = NSStringFromClass([self class]); viewClassName = ...

  8. HDU 3333 - Turing Tree (树状数组+离线处理+哈希+贪心)

    题意:给一个数组,每次查询输出区间内不重复数字的和. 这是3xian教主的题. 用前缀和的思想可以轻易求得区间的和,但是对于重复数字这点很难处理.在线很难下手,考虑离线处理. 将所有查询区间从右端点由 ...

  9. EventBus vs Otto vs LiteEventBus

    http://blog.chengyunfeng.com/?p=449 http://litesuits.com/

  10. Ubuntu 开启ssh

    sudo apt-get install openssh-server Ubuntu缺省安装了openssh-client,所以在这里就不安装了,如果你的系统没有安装的话,再用apt-get安装上即可 ...