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

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -