This is a sample text file. Your program should add a space after the
following comma,and after this comma,but not after this comma, because
there is already a space. Similarly, it should add a space after the
following fullstop.And after this fullstop.But not after this fullstop.
Goodluck.

I want to transform it into this: # (using fscanf and fprintf) and having already the first text file.

This is a sample text file. Your program should add a space after the
following comma, and after this comma, but not after this comma, because
there is already a space. Similarly, it should add a space after the
following fullstop. And after this fullstop. But not after this fullstop.
Goodluck.

Any idea on how to do that?

Sure, but that won't help you. How would YOU solve this - forget the computer for now. Solve it by pen and paper a few times, very slowly.

How did you do that?

Write down the steps you took to solve it, and use small steps. BECOME the tip of the pen, as you are solving it.

Do that a few times, and eventually you will begin to notice definite patterns emerging. Those patterns, will form the backbone of the logic for your program.

This is too good and simple to be giving you ANY hints -- it is VERBOTEN! ;)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.