• Linux 将文件中部分内容替换大小写


    需求

    将文件V_FEE_DSSITF.sql中标红的部分替换为小写,其它内容不变。

      CREATE OR REPLACE FORCE NONEDITIONABLE VIEW "CFPS7_CGO_TEST"."V_FEE_DSSITF" ("BILLID", "STOCKTYPEID", "STOCKPRE", "STOCKNO", "FEENM", "AIRPORTID", "FEE", "FEETIME", "FEEDELFLAG") AS
      select billid, stocktypeid, stockpre, stockno, feenm,airportid, sum(fee) as fee,feetime,feedelflag
      from (select vfee.stocktypeid,
                   vfee.stockpre,
                   vfee.stockno,
                   vfee.billid,
                   usrope.airportid,
                   case
                     when (vfee.feeshortnm like '%fee1%' or vfee.feeshortnm like '%fee2%') Then
                      'store'
                     when (vfee.feeshortnm like '%fee1%' or vfee.feeshortnm like '%fee2%') Then
                      'deal'
                     when vfee.feeshortnm like '%fee3%' Then
                      'ext'
                     Else
                      'other'
                   end feenm,
                   nvl(vfee.fee,0) fee,
                   vfee.feecrtopetime feetime,
                               decode(vfee.feedelopetime,null,'N','Y') feedelflag
              from v_fee_fee vfee,t_usr_opedepart usrope
              where vfee.feeopedepartid=usrope.opedepartid
             order by vfee.billid, vfee.feeshortnm)
     group by billid, stocktypeid, stockpre, stockno, feenm,airportid,feetime,feedelflag
     order by feedelflag desc,billid, feenm

     ;
     

    操作命令

    #sed 's/\"CFPS7_CGO_TEST\".\"[A-Z_]*\"/\L&/g' V_FEE_DSSITF.sql

    输出结果


      CREATE OR REPLACE FORCE NONEDITIONABLE VIEW "cfps7_cgo_test"."v_fee_dssitf" ("BILLID", "STOCKTYPEID", "STOCKPRE", "STOCKNO", "FEENM", "AIRPORTID", "FEE", "FEETIME", "FEEDELFLAG") AS
      select billid, stocktypeid, stockpre, stockno, feenm,airportid, sum(fee) as fee,feetime,feedelflag
      from (select vfee.stocktypeid,
                   vfee.stockpre,
                   vfee.stockno,
                   vfee.billid,
                   usrope.airportid,
                   case
                     when (vfee.feeshortnm like '%fee1%' or vfee.feeshortnm like '%fee2%') Then
                      'store'
                     when (vfee.feeshortnm like '%fee1%' or vfee.feeshortnm like '%fee2%') Then
                      'deal'
                     when vfee.feeshortnm like '%fee3%' Then
                      'ext'
                     Else
                      'other'
                   end feenm,
                   nvl(vfee.fee,0) fee,
                   vfee.feecrtopetime feetime,
                               decode(vfee.feedelopetime,null,'N','Y') feedelflag
              from v_fee_fee vfee,t_usr_opedepart usrope
              where vfee.feeopedepartid=usrope.opedepartid
             order by vfee.billid, vfee.feeshortnm)
     group by billid, stocktypeid, stockpre, stockno, feenm,airportid,feetime,feedelflag
     order by feedelflag desc,billid, feenm

     ;

  • 相关阅读:
    面试题____Java小白找工作必须领悟的修仙秘籍(二)
    LeetCode刷题记录-简单模块(三)
    Acwing 844. 走迷宫
    FPGA实现图像二值形态学滤波——腐蚀膨胀
    【深度学习】卷积神经网络,测试两段代码
    浅谈云上攻防系列——云IAM原理&风险以及最佳实践
    XLA之HloModule“合并”
    nuitka 打包成exe文件怎么样打包可以不需要安装python环境运行
    OpenCV读取ESP32CAM的视频流
    【熬夜爆肝版】JAVA基础入门专栏——1.JAVA开发入门
  • 原文地址:https://blog.csdn.net/usoa/article/details/132715589