sed + remove “#” and empty lines with one sed command

后端 未结 7 1984
旧巷少年郎
旧巷少年郎 2020-12-08 02:57

how to remove comment lines (as # bal bla ) and empty lines (lines without charecters) from file with one sed command?

THX lidia

相关标签:
7条回答
  • 2020-12-08 03:53

    you can use awk

    awk 'NF{gsub(/^[ \t]*#/,"");print}' file
    
    0 讨论(0)
提交回复
热议问题