1.

Solve : 'find and replace' code?

Answer» HELLO! I'm using Fortran for the first time and I need to write a program which find all ',' in a TEXT file and replace them with ' '. I can't do it just using 'replace' in 'edit' because I need to produce an .exe file in order to automate its execution.
Thanks a lot in advance! Fortran has a replace function you can use. Once again Google has all the messy details.

Code: [Select]REPLACE(string,target,substring,every,back)

Quote
the COPY of string is searched for occurrences of target. The search is done in the backward direction if the argument back is present with the value true, and in the forward direction OTHERWISE. If target is found, it is replaced by substring. If every is present with the value true, the search and replace is continued from the character following target in the search direction specified until all occurrences of target in the copy string are replaced; otherwise only the first occurrence of target is replaced.
Source

This should work:

var = replace(string, ',', ' ', True)

Couldn't tell if the replacement is a space or a null. Fix if necessary.



Discussion

No Comment Found