【发布时间】:2009-11-27 12:42:48
【问题描述】:
我有一个文本文件,其中包含:
Cycle code
Cycle month
Cycle year
Event type ID
Event ID
Network start time
我想更改此文本,以便在有空格时将其替换为_。之后,我希望字符变为小写字母,如下所示:
cycle_code
cycle_month
cycle_year
event_type_id
event_id
network_start_time
我怎样才能做到这一点?
【问题讨论】:
-
是“sed 或 awk”还是“sed、awk 或 Perl”?
-
任何可以解决我问题的方法