match whitespace at start of line

  • Follow


Hi,
  please forgive newbie confusion.
  using GNU Awk 3.5.1 on Cygwin.

how can I match one or more
spaces and/or tabs at the
start of a line?

Thanks, Jeff Higgins 


0
Reply oohiggins (266) 10/19/2005 3:23:09 PM

Jeff Higgins wrote:
> Hi,
>   please forgive newbie confusion.
>   using GNU Awk 3.5.1 on Cygwin.
> 
> how can I match one or more
> spaces and/or tabs at the
> start of a line?
> 
> Thanks, Jeff Higgins 
> 
> 
awk '/^[ \t]+/'

Regards,

Steffen
0
Reply Steffen 10/19/2005 3:30:11 PM



Steffen Schuler wrote:
> Jeff Higgins wrote:
> 
>> Hi,
>>   please forgive newbie confusion.
>>   using GNU Awk 3.5.1 on Cygwin.
>>
>> how can I match one or more
>> spaces and/or tabs at the
>> start of a line?

As an RE for one of the *sub() commands to replace, or just a pattern to 
match as the condition part of the awk body?

>> Thanks, Jeff Higgins
>>
> awk '/^[ \t]+/'

No need for the "+" in that case.

	Ed.
0
Reply Ed 10/19/2005 3:36:50 PM

<SNIP>
As a match pattern.
Please see my forthcoming post.
Thank you and Steffen very much for your help.
Jeff Higgins 


0
Reply Jeff 10/19/2005 4:41:13 PM

3 Replies
196 Views

(page loaded in 0.086 seconds)

Similiar Articles:













7/24/2012 6:42:06 AM


Reply: