【发布时间】:2009-12-14 22:26:00
【问题描述】:
我有一些配置文件,每个文件都有数百行数据。
我想以井号 ('#') 开始每一行(回车后)除非它已经以井号开始。我不想进行查找+替换,因为我有文件的其他注释部分不是行首。
例如,这个:
Some data #some comment
Some more data #some other comment
Even more data
#some line comment
会变成:
#Some data #some comment
#Some more data #some other comment
#Even more data
#some line comment
【问题讨论】: