• 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

     ;

  • 相关阅读:
    【吐血整理】2022年Java 基础高频面试题及答案(收藏)
    Python爬取豆瓣电影+数据可视化,爬虫教程!
    TGK-Planner无人机运动规划算法解读
    SSM学习33:Spring整合MyBatis(重点)
    Spring Security OAuth2.0 实现分布式系统的认证和授权
    Kafka消息队列
    阿里P8架构大神分享纯手写“kafka文档”看完直呼太牛!
    学业辅导导师:文心一言智能体详细介绍和开发
    汇编分析Swift中的String
    大数据架构师——数据湖技术(二)
  • 原文地址:https://blog.csdn.net/usoa/article/details/132715589