Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help Parsing a line

Status
Not open for further replies.

chomps303

MIS
Sep 30, 2003
83
US
How can I parse out a line like this?

[Tab][Space][Space] data data data [tab] data data

I can have any number of tabs and or spaces in the beginning of the line the line may contain tabs or spaces
AFTER the data is started. I just need to LEFT justify the the line.

ie: data data data [tab] data data

Thanks
Brandt
 
Something like this ?
t=`echo "\t\c"`; sed "s!^[ $t]*!!" /path/to/input > output
The awk way:
awk '{x=$0;sub(/^[ \t]*/,"",x);print x}' /path/to/input > output

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top