合并两个非常大的文件,忽略第一句 [英] Combining two very large files ignoring the first sentence

查看:47
本文介绍了合并两个非常大的文件,忽略第一句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将两个数百兆的巨型文件合并为一个文件,而忽略第一行.

I want to combine two giant file each few hundred megabyte into a single file while ignoring the first line.

我想使用awk,因为我认为这应该是最优化的方法.我这样做的方式只会忽略第二个文件的第一行. 知道如何做工作或是否有更快的工作方法吗?

I wanted to use awk as I thought it should be the most optimized way. the way I'm doing it only ignores the first line of second file. Any idea how to do make work or if there's a faster way to do it?

awk 'FNR!=NR && FNR==1 {next} 1' 'FNR!=NR && FNR==1 {next} 2' s_mep_{1,2}.out >> s_mep.out

推荐答案

$ awk 'FNR>1' file{1,2} > file_12

这篇关于合并两个非常大的文件,忽略第一句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆