How to remove spaces from strings?

Using applications, configuring, problems
Post Reply
Message
Author
Lumaja
Posts: 1
Joined: Sat 17 Aug 2013, 13:13

How to remove spaces from strings?

#1 Post by Lumaja »

Ubuntu 12.04 precise

I get this figures in different cells as strings but they can be converted to numbers without the spaces.

786 879
3 825 647
4 612 526

How to convert them
Thank you

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

#2 Post by L18L »

Code: Select all

# echo "123 456" |  sed 's/ //g' 
123456
#

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#3 Post by don570 »

You can avoid using sed by using a string operation.

It's explained well in the Advanced Bash scripting guide

http://www.tldp.org/LDP/abs/html/refcards.html#AEN22664
___________________________________________________

Post Reply