perl - linux + cut file until specific word -
i have file following format
how cut file until line start number 2 ( not include line 2 )
before new line number 2 spaces or tabs ,
remark - implementation can done ksh or awk or sed or perl 1 liner etc
file:
* 0       text  text  .  .   1   text  text  .  .   2   text  text  .  .   3   text  text  .  . 
perl one-liner:
perl -pwe 'exit if $_ =~ /^\s*2/' file this allows number of spaces between start of line , number 2
Comments
Post a Comment