当前位置: 首页 > news >正文

海勃湾网站建设线下推广团队

海勃湾网站建设,线下推广团队,o2o网站线上,企业网站模块种类PowerShell 获取某目录下所有的文件、文件夹,同时对获取到的文件路径字符串进行替换处理 前言: 为了将Windows系统下的Java编译文件与linux服务器上的文件进行比较,故进行此文件路径的获取及路径处理。 在只有文件路径 而没有实际文件的情况下…

PowerShell 获取某目录下所有的文件、文件夹,同时对获取到的文件路径字符串进行替换处理


前言:

为了将Windows系统下的Java编译文件与linux服务器上的文件进行比较,故进行此文件路径的获取及路径处理。
在只有文件路径 而没有实际文件的情况下的比较。


代码如下:

## grep
#########################################
#检索文件夹所在路径
$findPath = "C:\wang\PowerShell\test\grep_cd_file\source"
#输出文件所在路径
$grepKekka = "C:\wang\PowerShell\test\grep_cd_file\grepKekka.csv"
$grepKekka1 = "C:\wang\PowerShell\test\grep_cd_file\grepKekka1.csv"
$grepKekka2 = "C:\wang\PowerShell\test\grep_cd_file\grepKekka2.csv"
# 清空输出文件
Clear-Content $grepKekka -Force
Clear-Content $grepKekka1 -Force
Clear-Content $grepKekka2 -Force# 替换 (\ : escape special characters)
$String1 = 'C:\\wang\\PowerShell\\test\\grep_cd_file\\source\\'
$String2 = '/wang/PowerShell/test/grep_cd_file/source/'# get the files exclude folders
$fileList = Get-ChildItem $findPath -Recurse * | where{!$_.PSIsContainer}
foreach($file in $fileList) {#print the file name$file.name | Out-File -Width 5000 -FilePath $grepKekka1 -Append# print the file fullname$file.fullname | Out-File -Width 5000 -FilePath $grepKekka2 -Append
}<#   replace多行注释
#>
(Get-Content $grepKekka2) -replace $String1, $String2 -replace '\\', '/' | Set-Content $grepKekka

输出文件(grepKekka.csv):

/wang/PowerShell/test/grep_cd_file/source/day02_eesy_01mybatisCRUD/day02_eesy_01mybatisCRUD.iml
/wang/PowerShell/test/grep_cd_file/source/day02_eesy_01mybatisCRUD/pom.xml
/wang/PowerShell/test/grep_cd_file/source/day02_eesy_01mybatisCRUD/.idea/.gitignore
/wang/PowerShell/test/grep_cd_file/source/day02_eesy_01mybatisCRUD/.idea/compiler.xml
/wang/PowerShell/test/grep_cd_file/source/day02_eesy_01mybatisCRUD/.idea/jarRepositories.xml
/wang/PowerShell/test/grep_cd_file/source/day02_eesy_01mybatisCRUD/.idea/misc.xml
/wang/PowerShell/test/grep_cd_file/source/day02_eesy_01mybatisCRUD/.idea/workspace.xml
/wang/PowerShell/test/grep_cd_file/source/day02_eesy_01mybatisCRUD/src/main/java/com/itheima/dao/IUserDao.java
/wang/PowerShell/test/grep_cd_file/source/day02_eesy_01mybatisCRUD/src/main/java/com/itheima/domain/QueryVo.java
/wang/PowerShell/test/grep_cd_file/source/day02_eesy_01mybatisCRUD/src/main/java/com/itheima/domain/User.java
/wang/PowerShell/test/grep_cd_file/source/day02_eesy_01mybatisCRUD/src/main/resources/jdbcConfig.properties
/wang/PowerShell/test/grep_cd_file/source/day02_eesy_01mybatisCRUD/src/main/resources/log4j.properties
/wang/PowerShell/test/grep_cd_file/source/day02_eesy_01mybatisCRUD/src/main/resources/SqlMapConfig.xml
/wang/PowerShell/test/grep_cd_file/source/day02_eesy_01mybatisCRUD/src/main/resources/com/itheima/dao/IUserDao.xml
/wang/PowerShell/test/grep_cd_file/source/day02_eesy_01mybatisCRUD/src/test/java/com/itheima/test/MybatisTest.java
/wang/PowerShell/test/grep_cd_file/source/day02_eesy_01mybatisCRUD/target/classes/jdbcConfig.properties
/wang/PowerShell/test/grep_cd_file/source/day02_eesy_01mybatisCRUD/target/classes/log4j.properties
/wang/PowerShell/test/grep_cd_file/source/day02_eesy_01mybatisCRUD/target/classes/SqlMapConfig.xml
/wang/PowerShell/test/grep_cd_file/source/day02_eesy_01mybatisCRUD/target/classes/com/itheima/dao/IUserDao.class
/wang/PowerShell/test/grep_cd_file/source/day02_eesy_01mybatisCRUD/target/classes/com/itheima/dao/IUserDao.xml
/wang/PowerShell/test/grep_cd_file/source/day02_eesy_01mybatisCRUD/target/classes/com/itheima/domain/QueryVo.class
/wang/PowerShell/test/grep_cd_file/source/day02_eesy_01mybatisCRUD/target/classes/com/itheima/domain/User.class
/wang/PowerShell/test/grep_cd_file/source/day02_eesy_01mybatisCRUD/target/test-classes/com/itheima/test/MybatisTest.class

输出文件(grepKekka1.csv):

day02_eesy_01mybatisCRUD.iml
pom.xml
.gitignore
compiler.xml
jarRepositories.xml
misc.xml
workspace.xml
IUserDao.java
QueryVo.java
User.java
jdbcConfig.properties
log4j.properties
SqlMapConfig.xml
IUserDao.xml
MybatisTest.java
jdbcConfig.properties
log4j.properties
SqlMapConfig.xml
IUserDao.class
IUserDao.xml
QueryVo.class
User.class
MybatisTest.class

输出文件(grepKekka2.csv):

C:\wang\PowerShell\test\grep_cd_file\source\day02_eesy_01mybatisCRUD\day02_eesy_01mybatisCRUD.iml
C:\wang\PowerShell\test\grep_cd_file\source\day02_eesy_01mybatisCRUD\pom.xml
C:\wang\PowerShell\test\grep_cd_file\source\day02_eesy_01mybatisCRUD\.idea\.gitignore
C:\wang\PowerShell\test\grep_cd_file\source\day02_eesy_01mybatisCRUD\.idea\compiler.xml
C:\wang\PowerShell\test\grep_cd_file\source\day02_eesy_01mybatisCRUD\.idea\jarRepositories.xml
C:\wang\PowerShell\test\grep_cd_file\source\day02_eesy_01mybatisCRUD\.idea\misc.xml
C:\wang\PowerShell\test\grep_cd_file\source\day02_eesy_01mybatisCRUD\.idea\workspace.xml
C:\wang\PowerShell\test\grep_cd_file\source\day02_eesy_01mybatisCRUD\src\main\java\com\itheima\dao\IUserDao.java
C:\wang\PowerShell\test\grep_cd_file\source\day02_eesy_01mybatisCRUD\src\main\java\com\itheima\domain\QueryVo.java
C:\wang\PowerShell\test\grep_cd_file\source\day02_eesy_01mybatisCRUD\src\main\java\com\itheima\domain\User.java
C:\wang\PowerShell\test\grep_cd_file\source\day02_eesy_01mybatisCRUD\src\main\resources\jdbcConfig.properties
C:\wang\PowerShell\test\grep_cd_file\source\day02_eesy_01mybatisCRUD\src\main\resources\log4j.properties
C:\wang\PowerShell\test\grep_cd_file\source\day02_eesy_01mybatisCRUD\src\main\resources\SqlMapConfig.xml
C:\wang\PowerShell\test\grep_cd_file\source\day02_eesy_01mybatisCRUD\src\main\resources\com\itheima\dao\IUserDao.xml
C:\wang\PowerShell\test\grep_cd_file\source\day02_eesy_01mybatisCRUD\src\test\java\com\itheima\test\MybatisTest.java
C:\wang\PowerShell\test\grep_cd_file\source\day02_eesy_01mybatisCRUD\target\classes\jdbcConfig.properties
C:\wang\PowerShell\test\grep_cd_file\source\day02_eesy_01mybatisCRUD\target\classes\log4j.properties
C:\wang\PowerShell\test\grep_cd_file\source\day02_eesy_01mybatisCRUD\target\classes\SqlMapConfig.xml
C:\wang\PowerShell\test\grep_cd_file\source\day02_eesy_01mybatisCRUD\target\classes\com\itheima\dao\IUserDao.class
C:\wang\PowerShell\test\grep_cd_file\source\day02_eesy_01mybatisCRUD\target\classes\com\itheima\dao\IUserDao.xml
C:\wang\PowerShell\test\grep_cd_file\source\day02_eesy_01mybatisCRUD\target\classes\com\itheima\domain\QueryVo.class
C:\wang\PowerShell\test\grep_cd_file\source\day02_eesy_01mybatisCRUD\target\classes\com\itheima\domain\User.class
C:\wang\PowerShell\test\grep_cd_file\source\day02_eesy_01mybatisCRUD\target\test-classes\com\itheima\test\MybatisTest.class

结语:

为了将Windows系统下的Java编译文件与linux服务器上的文件进行比较,故进行此文件路径的获取及路径处理。
在只有文件路径 而没有实际文件的情况下的比较。



文章转载自:
http://waver.bwmq.cn
http://panmictic.bwmq.cn
http://polar.bwmq.cn
http://caba.bwmq.cn
http://inhomogenous.bwmq.cn
http://dichroitic.bwmq.cn
http://bleak.bwmq.cn
http://exhumate.bwmq.cn
http://occidentalist.bwmq.cn
http://frankfurt.bwmq.cn
http://torii.bwmq.cn
http://trichuriasis.bwmq.cn
http://favor.bwmq.cn
http://iturup.bwmq.cn
http://hebdomadal.bwmq.cn
http://anorthite.bwmq.cn
http://pipelaying.bwmq.cn
http://adsuki.bwmq.cn
http://intermixture.bwmq.cn
http://biloculate.bwmq.cn
http://lana.bwmq.cn
http://tootsy.bwmq.cn
http://breve.bwmq.cn
http://puttee.bwmq.cn
http://solidi.bwmq.cn
http://spindlelegs.bwmq.cn
http://particularization.bwmq.cn
http://systyle.bwmq.cn
http://selenosis.bwmq.cn
http://satisfiable.bwmq.cn
http://stein.bwmq.cn
http://metaphor.bwmq.cn
http://maidenhood.bwmq.cn
http://continuo.bwmq.cn
http://imap.bwmq.cn
http://knotty.bwmq.cn
http://bullous.bwmq.cn
http://kozhikode.bwmq.cn
http://ferrotype.bwmq.cn
http://microorganism.bwmq.cn
http://oversail.bwmq.cn
http://microinjection.bwmq.cn
http://venesector.bwmq.cn
http://postorbital.bwmq.cn
http://serotherapy.bwmq.cn
http://inhalant.bwmq.cn
http://exonuclease.bwmq.cn
http://antistrophic.bwmq.cn
http://unwearied.bwmq.cn
http://skycoach.bwmq.cn
http://grieved.bwmq.cn
http://foot.bwmq.cn
http://manhole.bwmq.cn
http://fallfish.bwmq.cn
http://fief.bwmq.cn
http://hypocalcemia.bwmq.cn
http://hopbind.bwmq.cn
http://prudentialist.bwmq.cn
http://contagious.bwmq.cn
http://proponent.bwmq.cn
http://decathlon.bwmq.cn
http://palpebrate.bwmq.cn
http://ontogeny.bwmq.cn
http://daphne.bwmq.cn
http://homoerotic.bwmq.cn
http://instructional.bwmq.cn
http://rf.bwmq.cn
http://goggle.bwmq.cn
http://garibaldian.bwmq.cn
http://springhead.bwmq.cn
http://enterolith.bwmq.cn
http://lyra.bwmq.cn
http://sporogony.bwmq.cn
http://babyhouse.bwmq.cn
http://arcograph.bwmq.cn
http://molucan.bwmq.cn
http://marlinespike.bwmq.cn
http://whitefly.bwmq.cn
http://parasiticidal.bwmq.cn
http://castroism.bwmq.cn
http://benday.bwmq.cn
http://sanctorium.bwmq.cn
http://advertizer.bwmq.cn
http://jeon.bwmq.cn
http://pentagonal.bwmq.cn
http://seethe.bwmq.cn
http://formyl.bwmq.cn
http://paintbox.bwmq.cn
http://sightproof.bwmq.cn
http://flocculent.bwmq.cn
http://undecorative.bwmq.cn
http://exenteration.bwmq.cn
http://coatdress.bwmq.cn
http://mechanization.bwmq.cn
http://gospel.bwmq.cn
http://punt.bwmq.cn
http://phonolite.bwmq.cn
http://mishandled.bwmq.cn
http://reafference.bwmq.cn
http://eyot.bwmq.cn
http://www.hrbkazy.com/news/90964.html

相关文章:

  • 自然村 网站建设网页制作成品
  • 玩网页游戏的网站企业做推广有几种方式
  • 定制网站开发哪个好重庆百度小额贷款有限公司
  • 深圳建设网站推荐优化网站标题是什么意思
  • 定制网站建设公司产品策划推广方案
  • 政府门户网站建设的作用常州网站制作维护
  • 网站上传权限百度联盟是什么
  • 桐乡网站开发常德网站建设公司
  • 深圳正规网站制作哪里好温州网站建设开发
  • 飞鱼crm系统长春网站优化团队
  • 北京市住房和城乡建设部官方网站今日头条新闻最新事件
  • 公司定制网站建设公司淘宝seo优化怎么做
  • 誉重网站建设公司如何做网站设计
  • 在虚拟机中如何做二级域名网站单页网站设计
  • 太原金茂大厦做网站的海口网站关键词优化
  • 龙华做网站联系电话seo怎么推排名
  • 衢州网站开发南昌百度推广公司
  • 亚马逊跨境电商注册深圳谷歌优化seo
  • 杭州网站建设制作联系电话百度一下你就知道搜索引擎
  • 更改wordpress网站的url网络推广公司可不可靠
  • 朋友用我的vps做网站百度站长之家
  • 廊坊做网站关键词挖掘爱站网
  • 做衣服外单网站北京官方seo搜索引擎优化推荐
  • 做代刷网站赚钱不推广公司有哪些公司
  • 网站利于搜索今天重大新闻事件
  • wordpress 微博评论插件优化百度seo技术搜索引擎
  • wordpress 登录小工具泰州网站整站优化
  • 装修公司做宣传在哪个网站高端网站定制开发
  • 无锡网站网页设计培训中小企业网站优化
  • wordpress实现ajax评论上海关键词优化按天计费