这个小程序的目的是将二级目录下的文件全部合并成一个文件(其实几级目录都可以,只要做少许改动) #coding:utf8 import sys, os def process(path): new_file = open("file_1", "a+") for secDir in os.listdir(path): for f in os.listdir(path + "/" + secDir): fin = open(path + "/
原文件 第一种方法 [root@wxb- jt]# paste -d "," b c d ,q, , ,e, ,r, ,t, [root@wxb- jt]# paste b c d q e r t 默认是tab分割. 第二种方法 [root@wxb- jt]# awk 'NR==FNR{a[i]=$0;i++}NR>FNR{print a[j]" "$0;j++}' b c q w e r t
sqlContext.sql(""" SELECT user_no,cust_id,oper_code FROM cui.operation_data_android WHERE user_no <> 'null'""").repartition(1).saveAsTextFile("/out.txt")