sufi:
You just about have it. You're replacing all whitespace with commas. The problem is that the end of line \n is a whitespace character. You're turning it into a comma. You should chop off the end of line before you do your replacement, and then you can add it back when you print the line. Then you'll have solved your problem.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
In reply to Re^3: Replace spaces with commas and write to other file
by roboticus
in thread Replace spaces with commas and write to other file
by sufi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |