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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

strip leading white space

Status
Not open for further replies.

ng1

Technical User
Aug 22, 2007
39
0
0
US
I have a file that contains 1 line. It has a number in it.



ex.
706,423.97



It has a variable amount of leading white space. What is a simple way to get rid of the leading white space? I have searched for a nice easy way but have not found it yet.
 
Never mind.

I found an easy way to do it with sed.

sed 's/^[ \t]*//'
 
Some other solutions:

[tt]echo $(</path/to/your/file)
tr -d '[:blank:]' </path/to/your/file[/tt]


HTH,

p5wizard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top