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 3926: 诸神眷顾的幻想乡 广义后缀自动机
题目: Description 幽香是全幻想乡里最受人欢迎的萌妹子,这天,是幽香的2600岁生日,无数幽香的粉丝到了幽香家门前的太阳花田上来为幽香庆祝生日. 粉丝们非常热情,自发组织表演了一系列节目给 ...
- P1330 封锁阳光大学(二分图染色)
题目描述 曹是一只爱刷街的老曹,暑假期间,他每天都欢快地在阳光大学的校园里刷街.河蟹看到欢快的曹,感到不爽.河蟹决定封锁阳光大学,不让曹刷街. 阳光大学的校园是一张由N个点构成的无向图,N个点之间由M ...
- photon server (1)
Photon是一套使用广泛的socket server引擎,服务端底层C++编写,客户端C#编写,跨多平台,收费,效率可观的一款引擎.实用上前有九城游戏(原魔兽世界代理),现在笔者发现多款腾讯旗下3D ...
- 系列文章--打造自己的MVC框架
MVC源码学习系列文章目录: MVC系列——MVC源码学习:打造自己的MVC框架(一:核心原理) MVC系列——MVC源码学习:打造自己的MVC框架(二:附源码) MVC系列——MVC源码学习:打造自 ...
- POJ2420:A Star not A Tree?
我对模拟退火的理解:https://www.cnblogs.com/AKMer/p/9580982.html 我对爬山的理解:https://www.cnblogs.com/AKMer/p/95552 ...
- 如何将OpenTSDB源码导入eclipse
OpenTSDB的官网上介绍了如何将OpenTSDB源码导入eclipse,官方链接,但步骤超级繁琐,还有一个简便方法,下面以导入OpenTSDB2.0.0为例. 1. 下载OpenTSDB2.0.0 ...
- RS485总线防雷保护方案
RS485作为最为最常用的电表通讯方式之一.日常生活中雷电和静电干扰已经成为485通信总线在实际工程经常遇到的问题.故如何对芯片以及总线进行有效的保护,是摆在每一个使用者面前的一个问题.在这里,我们主 ...
- Packet for query is too large
数据库:mysql5.6 framework: play framework 1.2.4 近日处理批量数据的insert,update,涉及的保存更新sql大概有18w.我的操作如下: 1)每次取10 ...
- 选择炸了(JIRA)的88个
作者:Martin Seibert SEIBERT MEDIA 首席执行官. 原文地址:http://seibert.biz/jirareasons 作者Martin Seibert 是德国互联网代理 ...
- DBVisualizer Pro for mac
公司使用的是DB2数据库,支持DB2的数据库客户端常用的有DBeaver和DBVisualizer.DBeaver是免费的,但本人电脑安装后,启动一直报错,问题一直没解决就放弃了.改用DBVisual ...