#!/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的更多相关文章

  1. 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 ...

  2. 网站访问出现 ------ Can not write to cache files, please check directory ./cache/ .

    最近在搞微商城时,突然出现了Can not write to cache files, please check directory ./cache/ .这样一个提示, 但最近好像没搞什么大动作,怎么 ...

  3. [Windows API] Listing the Files in a Directory,可用来数文件夹下有多少个子文件(夹)

    转载 #include <windows.h> #include <tchar.h> #include <stdio.h> #include <strsafe ...

  4. 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 ...

  5. Batch - 忽略FORFILES “no files found” error

    ref:https://stackoverflow.com/questions/16820681/suppress-forfiles-no-files-found-error Solution: Th ...

  6. 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 ...

  7. 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 ...

  8. C# 文件管理类 Directory

    今天简单接触了一下C#的文件管理类,对类的大体功能做了简单的了解; 做项目用于判断文件是否存.在创建文件.删除文件较为常用:今天大体总结文件调取功能: public string GetFile() ...

  9. Files and Directories

    Files and Directories Introduction     In the previous chapter we coveredthe basic functions that pe ...

随机推荐

  1. debian软件安装和卸载

    用root身份执行如下命令: dpkg -l |grep "^rc"|awk '{print $2}' |xargs aptitude -y purge dpkg是Debian P ...

  2. mybatis 学习二 conf xml 配置信息

    xml映射配置文件      这个xml文件主要包括一下节点信息      * properties 属性      * settings 设置      * typeAliases 类型命名     ...

  3. union联合体学习

    union,中文名“联合体.共用体”,在某种程度上类似结构体struct的一种数据结构,共用体(union)和结构体(struct)同样可以包含很多种数据类型和变量. 不过区别也挺明显: 结构体(st ...

  4. 【Java】Java程序员面试宝典(第三版)第5章----Java程序设计基本概念

    1.static静态变量,在次级作用域也可以被修改. 2.k++ + k++.第一个自加实际上只有在与计算+k++时补增.详情P36的题目. 3.Java数据类型从低到高分为(byte short c ...

  5. React中state和props的区别

    props和state都是用于描述component状态的,并且这个状态应该是与显示相关的. State 如果component的某些状态需要被改变,并且会影响到component的render,那么 ...

  6. CodeForces 1107F. Vasya and Endless Credits

    题目简述:给定 $n \leq 500$ 个贷款方式,其中第$i$个贷款额为$a_i$元,需要$k_i$个月偿还,每月还贷$b_i$元.在每个月月初可申请其中一个贷款,而在每个月月底时需要还贷.求:( ...

  7. Coding CTO 孙宇聪:《人,技术与流程》

    我先做一下自我介绍,我是 07 年加入的 Google,在 Moutain View 总部任Google SRE,今年年初回国加入 Coding . 在 Google 我参与了两个 Project, ...

  8. Entity Framework Code-First(10):Fluent API

    Fluent API in Code-First: We have seen different DataAnnotations attributes in the previous sections ...

  9. C#中的单体设计模式Singleton

    经典的单体设计模式的实现就是 有一个Public的类,在这个类中,有一个私有的private的构造函数. 然后有一个静态方法,这个静态方法返回这个类的实例 举个例子如下 Public class My ...

  10. Android Market google play store帐号注册方法流程 及发布应用注意事项

    Android Market google play store帐号申请 注册方法流程 在 Google Play 中发布软件之前,您需要完成以下三项工作: 创建开发人员个人资料 接受开发人员分发协议 ...