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学习历程—ZOJ3777 Problem Arrangement(递推 && 状压)
Description The 11th Zhejiang Provincial Collegiate Programming Contest is coming! As a problem sett ...
- ACM学习历程——UVA 127 "Accordian" Patience(栈;模拟)
Description ``Accordian'' Patience You are to simulate the playing of games of ``Accordian'' patie ...
- 向vivi中加入命令
在vivi的lib/command.c中添加自己的命令 核心数据结构user_command. typedef struct user_command { const char *name; ...
- python中http的一些编码转换
http的数据需要2种编码解码. 1. url中的特殊字符转换, 比如",', :,//等 python3中通过urllib.parse.quote(..)和urllib.parse.unq ...
- 从生成文件对比两种创建虚拟机的方式:boot from image和boot from bootable-volume
1. 创建bootable-volume(参考:http://docs.openstack.org/grizzly/openstack-compute/admin/content/instance-c ...
- 面向对象(Java中普通代码块,构造代码块,静态代码块区别及代码示例)
//执行顺序:(优先级从高到低.)静态代码块>mian方法>构造代码块>构造方法. 其中静态代码块只执行一次.构造代码块在每次创建对象是都会执行. 1 普通代码块 //普通代码块:在 ...
- SQL介绍(1)
SQL 是用于访问和处理数据库的标准的计算机语言. SQL,指结构化查询语言,全称是 Structured Query Language. SQL 让您可以访问和处理数据库. SQL 是一种 ANSI ...
- VC6.0 工程转到VS2010一些问题的描述及解决方法
下列为VC6.0 工程转到VS2008一些问题的描述及解决方法 //////////////////////////////////////////////////////////////////// ...
- Eclipse/MyEclipse下如何Maven管理多个Mapreduce程序?(企业级水平)
不多说,直接上干货! 如何在Maven官网下载历史版本 Eclipse下Maven新建项目.自动打依赖jar包(包含普通项目和Web项目) Eclipse下Maven新建Web项目index.jsp报 ...
- struts 文件上传示例
import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io ...