由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Linux版 - how to use "sed" for my task?
相关主题
linux tcsh下less的问题怎么吧一个目录下的所有文件名改成大写?
how do I remove this file???awk
dd-wrt 挂移动硬盘中文乱码的问题still can not install debian normally on dockstar
unix下运行perl输出.txt文件100伪币答谢Linux/Unix编程问题
kde is weak to display chinse fonts?吐血。。
ask a quention\!* 的作用是什么?
求几个linux命令知道问这个找打但是...
请问linux下有没有转换jp2图片格式的软件python + apache2 upload例子跑不了
相关话题的讨论汇总
话题: 123话题: sed话题: aoi话题: task话题: bcd
进入Linux版参与讨论
1 (共1页)
i***r
发帖数: 1035
1
folks,
i have a file like this:
1 123 abc
2 123 bcd
3 234 aoi
now i want:
aaa1 123 abc
aaa2 123 bcd
aaa3 234 aoi
basically i want to add aaa to the first number in a line. how to do it?
thanks,
w****w
发帖数: 521
2
sed 's/^/aaa/' filename

【在 i***r 的大作中提到】
: folks,
: i have a file like this:
: 1 123 abc
: 2 123 bcd
: 3 234 aoi
: now i want:
: aaa1 123 abc
: aaa2 123 bcd
: aaa3 234 aoi
: basically i want to add aaa to the first number in a line. how to do it?

i***r
发帖数: 1035
3
谢谢!我发现你经常帮助人!
我用了
awk '{print aaa$1 $2}' 也行
i***r
发帖数: 1035
4
谢谢!我发现你经常帮助人!
我用了
awk '{print aaa$1 $2}' 也行
x****o
发帖数: 21566
5
两个差不多
1 (共1页)
进入Linux版参与讨论
相关主题
python + apache2 upload例子跑不了kde is weak to display chinse fonts?
重新命名文件ask a quention
problem with "\"求几个linux命令
为什么请问linux下有没有转换jp2图片格式的软件
linux tcsh下less的问题怎么吧一个目录下的所有文件名改成大写?
how do I remove this file???awk
dd-wrt 挂移动硬盘中文乱码的问题still can not install debian normally on dockstar
unix下运行perl输出.txt文件100伪币答谢Linux/Unix编程问题
相关话题的讨论汇总
话题: 123话题: sed话题: aoi话题: task话题: bcd