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 ...
随机推荐
- bzoj 2794: Cloakroom dp
题目: 有\(n\)件物品,每件物品有三个属性\(a_i,b_i,c_i,(a_i < b_i)\) 再给出\(q\)个询问,每个询问由非负整数\(m,k,s\)组成,问是否能够选出某些物品使得 ...
- bzoj 2342: 双倍回文 回文自动机
题目大意: 定义双倍回文串的左一半和右一半均是回文串的长度为4的倍数的回文串 求一个给定字符串中最长的双倍回文串的长度 题解: 我们知道可以简单地判定以某一点结尾的最长回文串 我们知道可以简单地判定以 ...
- 制作spark镜像
构建镜像 添加jdk引用(可以使用yum进行安装): 安装SSH 碰到一个问题,执行systemctl的时候发生了异常: Failed to get D-Bus connection 解决这个问题的方 ...
- NSArray用法
//类方法初始化一个数组对象 [array count] : 得到这个数组对象的长度. [array objectAtIndex index]: 传入数组的索引(index) 得到数据对象. [arr ...
- 滑动swipe的妙用
转自:http://www.cnblogs.com/NEOCSL/archive/2013/03/04/2942861.html iterface ITouchable; function OnPic ...
- CentOS 7 配置 mariadb
一.安装mariadb : yum groupinstall mariadb mariadb-client -y 二.启动(设置开机启动)服务 : systemctl start (enabl ...
- HTTP ERROR
HTTP 400 – 请求无效HTTP 401.1 – 未授权:登录失败HTTP 401.2 – 未授权:服务器配置问题导致登录失败HTTP 401.3 – ACL 禁止访问资源HTTP 401.4 ...
- github 分支操作
1.查看分支 1.查看本地分支 使用git branch命令,如下: $ git branch * master *标识的是你当前所在的分支. 2.查看远程分支 命令如下: git branch -r ...
- 你所必须知道的HTML
只有在MySQL中可以使用"utf-8"的别名"utf8",但是在其他地方一律使用大写"UTF-8". htm 与 html 的区别 两种 ...
- Asp.net 微信企业号网页开发流程
一.在pageload方法中获取code var code = GetCode(); private string GetCode() { return HttpContext.Current.Req ...