Batch the files in the directory
#!/bin/bash
#sourceFolder = /home/bigdatagfts/pl62716/refdata
#targetFolder = /home/bigdatagfts/pl62716/refdata_target
sourceFolder=$
targetFolder=$
if [ $# != ] ; then
echo "USAGE: $0 sourceFolder hdfsFolder"
echo " e.g.: $0 /home/bigdatagfts/pl62716/refdata /home/bigdatagfts/pl62716/refdata_target"
exit ;
fi
if [ ! -d "$sourceFolder" ];then
echo "$sourceFolder is not exist, please check!"
exit ;
else
if [ ! -d "$targetFolder" ];then
echo "$targetFolder is not exist! create $targetFolder !"
mkdir -p "$targetFolder" fi
fi
echo "delete lines which begin with H/T and store to dir $targetFolder"
cd $sourceFolder
for file in `ls`
do
if test -f $file
then
if [ -f "$targetFolder/$file" ]; then
rm $targetFolder/$file
fi
sed '/^H\|^T/'d $file | cat -n > $targetFolder/$file
fi
done
Batch the files in the directory的更多相关文章
- How do I list the files in a directory?
原文地址:How do I list the files in a directory? You want a list of all the files, or all the files matc ...
- 网站访问出现 ------ Can not write to cache files, please check directory ./cache/ .
最近在搞微商城时,突然出现了Can not write to cache files, please check directory ./cache/ .这样一个提示, 但最近好像没搞什么大动作,怎么 ...
- [Windows API] Listing the Files in a Directory,可用来数文件夹下有多少个子文件(夹)
转载 #include <windows.h> #include <tchar.h> #include <stdio.h> #include <strsafe ...
- C# copy files from source directory to destination file and rename repeated files and does not override
static void CopyFiles() { string sourceDir = @"D:\C\ll"; string destDir = @"D:\LL&quo ...
- Batch - 忽略FORFILES “no files found” error
ref:https://stackoverflow.com/questions/16820681/suppress-forfiles-no-files-found-error Solution: Th ...
- Save results to different files when executing multi SQL statements in DB Query Analyzer 7.01
1 About DB Query Analyzer DB Query Analyzer is presented by Master Genfeng,Ma from Chinese Mainl ...
- Common Linux log files name and usage--reference
reference:http://www.coolcoder.in/2013/12/common-linux-log-files-name-and-usage.html if you spend lo ...
- C# 文件管理类 Directory
今天简单接触了一下C#的文件管理类,对类的大体功能做了简单的了解; 做项目用于判断文件是否存.在创建文件.删除文件较为常用:今天大体总结文件调取功能: public string GetFile() ...
- Files and Directories
Files and Directories Introduction In the previous chapter we coveredthe basic functions that pe ...
随机推荐
- ACM学习历程—UESTC 1215 Secrete Master Plan(矩阵旋转)(2015CCPC A)
题目链接:http://acm.uestc.edu.cn/#/problem/show/1215 题目大意就是问一个2*2的矩阵能否通过旋转得到另一个. 代码: #include <iostre ...
- HTML a标签如何设置margin属性(转)
很多同学发现对DIV有效的许多CSS属性对<a>或<p>标签都无效,好比说 <div style="margin-top:5px;"></ ...
- Python:struct模块的pack、unpack
mport struct pack.unpack.pack_into.unpack_from 1 # ref: http://blog.csdn<a href="http://lib. ...
- 【转】 Pro Android学习笔记(三三):Menu(4):Alternative菜单
目录(?)[-] 什么是Alternative menu替代菜单 小例子说明 Alternative menu代码 关于Category和规范代码写法 关于flags 多个匹配的itemId等参数 什 ...
- 【转】Pro Android学习笔记(十一):了解Intent(中)
Intent的构成 Intent可以带有action,data(由URI表达),extra data(key/value map,键值对),指定的类名(成为component name).一个inte ...
- 微服务理论之四:SOA
1.什么是SOA? SOA代表了面向服务的架构. SOA是一种使用松耦合的黑盒子服务构建业务应用的体系架构,这些服务可以通过编排连接在一起以实现特定的功能. 2.SOA特点 以下是服务的SOA的主要特 ...
- C# 自定义颜色
一.需要引用 using System.Windows.Media; 二. 自定义颜色 通过自定义 RGB 的值来达到自定义颜色的目的 Color _Mycolor = Color.FromRgb(5 ...
- window下rails4.1 发生TZInfo::DataSourceNotFound 错误 - smallbottle
在官网上学习rails 4.1 ,启动rails server之后发生了如下错误 $ rails server Booting WEBrick Rails 4.1.0 application star ...
- 07_ddms透视图介绍
通过ADB(Android Debug Bridge)安卓调试桥把你的Eclipse(集成开发环境)和你的设备连接在一起.有时候ADB可能会被其他的东西占用.例如WPS会跟你抢ADB(抢端口).如果你 ...
- 【PHP】composer 常用命令