This topic has been archived. It cannot be replied.
-
工作学习 / IT技术讨论 / 请问sed awk专家, 如何 delete the lines like
- in the scripts and in the outputted HTML.
- The "powered by" text/logo with a link back to
in multiple files(about 300), Thank you.
-studying2(彷徨者);
2003-8-25
(#1345638@0)
-
grep -v
-rhill(鱼棍一号);
2003-8-25
(#1345800@0)
-
1000+ 个文件在不同的目录下, 文件起始均包含下述内容, 想delete, 有什么regular expression能用. 谢谢大小侠.1000+ 个文件在不同的目录下, 文件起始均包含下述内容, 想delete, 有什么regular expression能用. 谢谢大小侠.
/* abcd
* in the scripts and in the outputted HTML.
* The "powered by" text/logo with a link back to in multiple files
*/
-studying2(彷徨者);
2003-8-27
{238}
(#1346960@0)
-
用这些shell 组合,你怎么那么多问题啊?for filename in `find . -name '*' -print`
do
tail -n `expr $(cat $filename|wc -l) \- 4` $filename > temp
mv temp $filename
done
或者简单一点,
tar -cvf all the files --> ftp to windows --> extract to a folder-->in exploring right click the folder --> find *-->select all--> send to editplus-->select the 4 lines-->ctrl+H-->change for all open files-->save-->tar-->ftp back-->done
-spaceman(人在江湖);
2003-8-27
{390}
(#1347027@0)
-
第三行应为tail -n `expr $(cat $filename|wc -l) \- 4` $filename > temp
-spaceman(人在江湖);
2003-8-27
(#1347067@0)
-
spaceman, 你是一个unix高手. 其实每个文件头的注释行数不一样, 我特想知道如何用regular express来表达. 我正在编个小c程序处理.非常感谢你的时间.
-studying2(彷徨者);
2003-8-28
(#1348301@0)
-
Answer is here, use a link because ROLIA can not display "\" correctly
-hillman(山大王);
2003-8-28
(#1348842@0)
-
thx hillman, you all misunderstood me. I just wanted delete all the begining comment lines in 1000+ files which resides under different folders. The comment contents and number of the contents differ from file to file.
-studying2(彷徨者);
2003-8-29
(#1350727@0)
-
That is easier. just sed '/\/\*/, /\*\// { d }' thefiles.name
-hillman(山大王);
2003-8-30
(#1351268@0)