![](/profiles/wavemetrics/themes/wavemetrics/logo.png)
Change All Dots to Comma in File
![](/sites/default/files/styles/thumbnail/public/default_images/Artboard%201_1.png?itok=jeHOCIXy)
![](/profiles/wavemetrics/themes/wavemetrics/images/icons/employee-icon.png)
hrodstein
// ChangeAllDotsToCommaInFile(pathName, fileName)
// Changes all dot characters to commas in the specified file.
// You might want to do this to output a data file that represents numbers using the conventional European decimal separator.
// NOTE: This may not work for Asian text that contains double-byte characters.
Function ChangeAllDotsToCommaInFile(pathName, fileName)
String pathName // Name of an Igor symbolic path or ""
String fileName // Name of file or full path to file
Variable refNum
// Open source file and read the raw text from it into a string variable
Open/Z=1/P=$pathName refNum as fileName
if (V_flag != 0)
return -1 // pathName and fileName do not fully specify the file to be opened
endif
FStatus refNum // Sets V_logEOF
Variable numBytesInFile = V_logEOF
String text = PadString("", numBytesInFile, 0x20)
FBinRead refNum, text // Read entire file into variable.
text = ReplaceString(".", text, ",")
FSetPos refNum, 0 // Write string back to file
FBinWrite refNum, text
Close refNum
return 0
End
// Changes all dot characters to commas in the specified file.
// You might want to do this to output a data file that represents numbers using the conventional European decimal separator.
// NOTE: This may not work for Asian text that contains double-byte characters.
Function ChangeAllDotsToCommaInFile(pathName, fileName)
String pathName // Name of an Igor symbolic path or ""
String fileName // Name of file or full path to file
Variable refNum
// Open source file and read the raw text from it into a string variable
Open/Z=1/P=$pathName refNum as fileName
if (V_flag != 0)
return -1 // pathName and fileName do not fully specify the file to be opened
endif
FStatus refNum // Sets V_logEOF
Variable numBytesInFile = V_logEOF
String text = PadString("", numBytesInFile, 0x20)
FBinRead refNum, text // Read entire file into variable.
text = ReplaceString(".", text, ",")
FSetPos refNum, 0 // Write string back to file
FBinWrite refNum, text
Close refNum
return 0
End
![](/sites/default/files/forum.png)
Forum
![](/sites/default/files/support.png)
Support
![](/sites/default/files/gallery.png)
Gallery
Igor Pro 9
Learn More
Igor XOP Toolkit
Learn More
Igor NIDAQ Tools MX
Learn More