免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1577 | 回复: 3
打印 上一主题 下一主题

copy file into another file problem [复制链接]

fatfish 该用户已被删除
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2003-06-03 22:02 |只看该作者 |倒序浏览
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
0
2 [报告]
发表于 2003-06-03 22:15 |只看该作者

copy file into another file problem

while read line_f1 <$file1; do
  while read line_f2 <$file2; do
      echo $line_f1 >> $output
      echo $line_f2 >> $output
   done
done

论坛徽章:
0
3 [报告]
发表于 2003-06-03 22:17 |只看该作者

copy file into another file problem

仅仅是一个治标的办法,供参考(SCOUNIX):
  1. sed -n -e '1,2p'  1.txt;sed -n -e '2,3p' 2.txt >3.txt
复制代码

论坛徽章:
0
4 [报告]
发表于 2003-06-04 01:35 |只看该作者

copy file into another file problem

原帖由 "fatfish" 发表:
i have files:

1.txt, 2.txt

1.txt
~~~~~~~~~~~~~~~~~~
hi
~~~~~~~~~~~~~~~~~`
2.txt
~~~~~~~~~~~~~~~~``
my friend
~~~~~~~~~~~~~~~
how to do the shell command to achieve
1.txt
~~~~~~~~~~~~~~..........
   


i'm very confused with your notation and statement. how many lines in 1.txt or 2.txt? should they just be concatenated or shold be done in certain order? are the wave lines "~~~~~" parts of the text? if not,

# cat 1.txt 2.txt > 3.txt

maybe solve your problem.

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP