由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - shell script for column operation
相关主题
怎么把一个文件的每一行合并到另外一个文件的对应行?a question about shell quote
请教怎样使用tar压文件Help please: 2GB limit on file size
Help! How to replace string in a variable?请问unix/Linux中设置共享目录
怎样将一个大文件分成两个文件?diff -y: how to suppress the same lines?
compare which file is newerquestion about appending file
[转载] compare请教一个文件处理的问题
怎么样循环执行一个命令?A question about show diff on vim
Remove core.xxxx files?How to do that using "sort" command?
相关话题的讨论汇总
话题: file2话题: file1话题: shell话题: script话题: column
进入Unix版参与讨论
1 (共1页)
f*******n
发帖数: 4
1
I have two file, file1 and file2.
the content of file1 is:
a1 b1
a2 b2
a3 b3
and the content of file2 is:
a1 c1
a2 c2
a3 c3
How to write a shell script to obtain a file with data look like:
a1 b1 c1
a2 b2 c2
a3 b3 c3
Thanks in advance
c*****t
发帖数: 1879
2
two commands: cut & paste
(no puns intended)

【在 f*******n 的大作中提到】
: I have two file, file1 and file2.
: the content of file1 is:
: a1 b1
: a2 b2
: a3 b3
: and the content of file2 is:
: a1 c1
: a2 c2
: a3 c3
: How to write a shell script to obtain a file with data look like:

f*******n
发帖数: 4
3
Thanks coconut;
I find "join file1 file2" works fine too.

【在 c*****t 的大作中提到】
: two commands: cut & paste
: (no puns intended)

w**a
发帖数: 1024
4
paste file1 file2 | awk '{print $1,$2,$4}' > output.dat

【在 f*******n 的大作中提到】
: I have two file, file1 and file2.
: the content of file1 is:
: a1 b1
: a2 b2
: a3 b3
: and the content of file2 is:
: a1 c1
: a2 c2
: a3 c3
: How to write a shell script to obtain a file with data look like:

1 (共1页)
进入Unix版参与讨论
相关主题
How to do that using "sort" command?compare which file is newer
请诊断:[转载] compare
请教一个问题怎么样循环执行一个命令?
help: how to copy files simultaneously to several foldersRemove core.xxxx files?
怎么把一个文件的每一行合并到另外一个文件的对应行?a question about shell quote
请教怎样使用tar压文件Help please: 2GB limit on file size
Help! How to replace string in a variable?请问unix/Linux中设置共享目录
怎样将一个大文件分成两个文件?diff -y: how to suppress the same lines?
相关话题的讨论汇总
话题: file2话题: file1话题: shell话题: script话题: column