Topic: Problems making a CSV file
I need to build a CSV (comma separated values) file as one of the outputs from my fortran program. Research on the web has indicated this is problematic in both formatted and format free output streams, and this has indeed turned out to be the case. My data output line includes variable length strings, integers, and reals. The problem is that it impossible to avoid generation of white space in the output. I have found I can use, for instance, Notepad or OpenOffice.org spreadsheet to remove these spaces in a post-processing effort, and this solves the problem for the most part, although not as elegantly as I would prefer. My issue is that I have one stubborn string, which still causes problems even after I have tried numerous variations in string length of the "A" edit descriptor. When I look at the problematic string in the appropriate column in my spreadsheet program, I see that it looks like:
'2009-12-15
This string (a date representation) is preceded in the output stream by a character that displays like a single tic quote; however, I have not found a windows program which recognizes it as such in a search operation. Notepad or other text processors do not display it at all. Interestingly, all of the data fields that are generated in my csv output stream contain this character; the difference is that if there is white space following it, as in:
' 45.6709
then either notepad or openOffice.org spreadsheet will successfully remove both the white space and the odd character when I search (and replace with null) using a standard keyboard blank (ascii character 32). The odd character is somehow associated/attached to the leading blank. If there is not white space immediately following the odd character and before the beginning of the actual character string, then the search and replace is unsuccessful, and therein lies my problem.
Does anyone have any thoughts about
1. A way to suppress this character in the fortran output stream?
2. What is the character; ie, its ascii or ansii code? Some sort of control character?
3. Ways to replace it with a null?
4. Other ideas?
thanks.....