How to remove multiple spaces in between word? (VI EDITOR)?


 
Thread Tools Search this Thread
Operating Systems Linux Ubuntu How to remove multiple spaces in between word? (VI EDITOR)?
# 1  
Old 03-09-2011
How to remove multiple spaces in between word? (VI EDITOR)?

What last line mode command allows me to remove extra spaces in between words in a text?
# 2  
Old 03-09-2011
Code:
:%s/ \+/ /g

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Remove a column using vi editor

How do i remove a column using vi editor Assuming the file to be of format 1: 010 0xad45 sp1 - 11:29:51.498583949 500249144 Event1 rst bcfe jhv rgc 456: 010 0xadb sp2 - 11:29:51.498600605 4464 Event0abcrd adabc aasd 45: 010 0x10 sp0 - 11:29:51.498614165 13560 Back adxca... (6 Replies)
Discussion started by: sp0
6 Replies

2. Shell Programming and Scripting

How to catch a two word keyword which may contain a new line(may include spaces or tab) in it?

How to catch a two word keyword which may contain a new line(may include spaces or tab) in it. for example there is a file a.txt. $more a.txt create view as (select from ......... .......... ( select .... ( select ...... .. select only no ((( number ( select end (12 Replies)
Discussion started by: neelmani
12 Replies

3. Shell Programming and Scripting

Prevent word splitting with file with spaces in name

Hello, I have a script that "validates" a ZIP file that look like this AAA_20120801.zip => x~back end~20120801.TXT y~time in~20120801.TXT z~heat_chamber~20120801.TXT AAA_20120801.ctlMy task is to compare its contents (i.e the list of files contained inside) with the control file that is... (2 Replies)
Discussion started by: alan
2 Replies

4. Shell Programming and Scripting

remove spaces

Hi folks, I need to remove spaces at the end of each line in a *.txt file. it looks like this word 1 word 2 . . . word n i found some sed commands but any of them didnt work so far thank you for your posts (6 Replies)
Discussion started by: Jimmy7
6 Replies

5. UNIX for Advanced & Expert Users

multiple vi editor

Hi Friends, Can some1 pls tell me how to do multiple vi editor(files) in a single screen and how to switch from file to another in that. Thanks (5 Replies)
Discussion started by: forroughuse
5 Replies

6. Shell Programming and Scripting

remove spaces between tags

I am having the data.txt file as follows. ------- <RMService> <ResControl> <ResultCode>FATAL</ResultCode> <ServiceTime>38</ServiceTime> <DWLControl> <requesterLanguage>100</requesterLanguage> <requesterLocale>en</requesterLocale> <requesterName>NCO A Batch... (6 Replies)
Discussion started by: kmanivan82
6 Replies

7. Shell Programming and Scripting

Remove Spaces

Hi All, I have a comma seperated file. I wanna remove the spaces from column 2. I mean i don't wanna remove the spaces those are presnt in column 1. ex: emp name, emp no, salary abc k, abc 11, 1000 00 bhk s, bhk 22, 2000 00 the output should be: emp name, emp no, salary abc k, abc11,... (4 Replies)
Discussion started by: javeed7
4 Replies

8. Shell Programming and Scripting

Remove spaces before a delimiter

Hi All, I need to modify a script to remove spaces from a csv file. The csv file is delimited by the '~' character and I need to remove the spaces which appear before this character. i.e Sample input: LQ001 SWAT 11767727 ~9104 ~001 ~NIRSWA TEST 18 ~2 ~Standard Test ~0011 Desired... (5 Replies)
Discussion started by: SRyan84
5 Replies

9. UNIX for Dummies Questions & Answers

how to delete spaces around a word

suppose a line has one word ex: unix how to delete space around that word? (8 Replies)
Discussion started by: sachin.gangadha
8 Replies

10. UNIX for Dummies Questions & Answers

Retaining Spaces within a word

Hi Experts, I have a 2 GB flat file which have unicode field, some of them are blanks and its size is 4000 character. In the existing system SED command removes the spaces. Because of this field itself....it is taking almost three days to complete the file processing. I removed sed and... (0 Replies)
Discussion started by: RcR
0 Replies
Login or Register to Ask a Question