Click here to Skip to main content
15,913,584 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: removing spaces-newbie [modified] Pin
Viorel.11-Jun-06 21:52
Viorel.11-Jun-06 21:52 
GeneralRe: removing spaces-newbie Pin
antonaras11-Jun-06 21:59
antonaras11-Jun-06 21:59 
GeneralRe: removing spaces-newbie Pin
Sarath C11-Jun-06 22:08
Sarath C11-Jun-06 22:08 
GeneralRe: removing spaces-newbie Pin
antonaras11-Jun-06 22:22
antonaras11-Jun-06 22:22 
GeneralRe: removing spaces-newbie Pin
toxcct11-Jun-06 22:55
toxcct11-Jun-06 22:55 
GeneralRe: removing spaces-newbie Pin
toxcct11-Jun-06 22:12
toxcct11-Jun-06 22:12 
GeneralRe: removing spaces-newbie Pin
Sarath C11-Jun-06 22:16
Sarath C11-Jun-06 22:16 
GeneralRe: removing spaces-newbie Pin
Viorel.11-Jun-06 22:19
Viorel.11-Jun-06 22:19 
If you do not use MFC, you can use STL. You can read the file using a stream object like ifstream, store strings in string object, and use find function to find a sequence consisting of two spaces. Then use find_first_not_of to find the end of sequence, and call erase to remove unneeded sequences.

If you do not use STL, you can use library functions: fgets to get strings, strstr or strchr to find spaces, and so on.

If you need to do this manually, you can open the file in Notepad and use Replace command

antonaras wrote:
i'm going to loose all spaces i need to leave only one.


The first parameter of Replace contains two spaces, and the second one -- a single space, so any sequence of more then one spaces will be replaced with only one (maybe not so fast as possible). For convenience, I modified the sample using underscores.
GeneralRe: removing spaces-newbie Pin
antonaras11-Jun-06 22:31
antonaras11-Jun-06 22:31 
GeneralRe: removing spaces-newbie Pin
David Crow12-Jun-06 3:08
David Crow12-Jun-06 3:08 
GeneralRe: removing spaces-newbie Pin
Viorel.12-Jun-06 3:20
Viorel.12-Jun-06 3:20 
GeneralRe: removing spaces-newbie Pin
David Crow12-Jun-06 3:29
David Crow12-Jun-06 3:29 
QuestionSeparate actions on Button click and button release Pin
Larssen2511-Jun-06 21:37
Larssen2511-Jun-06 21:37 
AnswerRe: Separate actions on Button click and button release Pin
_AnsHUMAN_ 11-Jun-06 22:15
_AnsHUMAN_ 11-Jun-06 22:15 
AnswerRe: Separate actions on Button click and button release Pin
Hamid_RT11-Jun-06 22:47
Hamid_RT11-Jun-06 22:47 
Questionadd source files to embedded VC 4.0 Pin
George_George11-Jun-06 21:36
George_George11-Jun-06 21:36 
Questionminimise and maximize button Pin
Manjunath S11-Jun-06 21:13
Manjunath S11-Jun-06 21:13 
AnswerRe: minimise and maximize button Pin
Sarath C11-Jun-06 22:14
Sarath C11-Jun-06 22:14 
QuestionDifficult when I change pc Pin
mikobi11-Jun-06 21:11
mikobi11-Jun-06 21:11 
AnswerRe: Difficult when I change pc Pin
Michael Dunn11-Jun-06 21:34
sitebuilderMichael Dunn11-Jun-06 21:34 
Question[Message Deleted] Pin
Rahul.RK11-Jun-06 20:54
Rahul.RK11-Jun-06 20:54 
AnswerRe: Function Call Pin
toxcct11-Jun-06 21:06
toxcct11-Jun-06 21:06 
QuestionRe: Function Call Pin
Rahul.RK11-Jun-06 21:27
Rahul.RK11-Jun-06 21:27 
AnswerRe: Function Call Pin
toxcct11-Jun-06 21:30
toxcct11-Jun-06 21:30 
AnswerRe: Function Call Pin
sunit511-Jun-06 21:08
sunit511-Jun-06 21:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.