I am currently working with two CSV files that has columns of either numerical data or alphabetical data. I am having problems with reading in the data for one of the files. The 1st CSV file has character data in this format:
,"NO EXCEED",
For this situation I have one character variable that reads the data. When I output the character variable it looks like NO EXCEED, without quotation marks.
However for the 2nd CSV file, character data is in this format:
,NO EXCEED,
For this situation fortran does not recognize NO EXCEED as one entry. It takes two character variables to read in this data: one character variable for NO and a second character variable for EXCEED. I guess for this case fortran recognizes both the comma and the space as delimiters, however I only want the comma as the delimiter.
When I open the files in excel, the columns are all correctly separated. That is for both files the column will look like NO EXCEED, without quotation marks (which is good). Only when I open the files using WordPad can I see the quotation marks for the 1st file.
The character variables are defined like:
character*12 A
How do I work around this problem or does the CSV file have to be changed? In order for fortran to process CSV files with character data, does the character data have to be put in quotation marks? If I have to change the CSV file what is the best method to do this? The files are bigger than 1 gig.
The 2nd CSV file is exactly the same as the 1st CSV file, except the 2nd file has more data and the character data does not have quotation marks. The CSV files are sent from third/fourth party and the data is sent as a favor so if it's possible I would like to resolve this problem on my own. I am programming with fortran 77 using Microsoft Visual Studio 2008.
I hope there is enough information, if not please tell me what is missing and I will supply. Thank you for your help.
,"NO EXCEED",
For this situation I have one character variable that reads the data. When I output the character variable it looks like NO EXCEED, without quotation marks.
However for the 2nd CSV file, character data is in this format:
,NO EXCEED,
For this situation fortran does not recognize NO EXCEED as one entry. It takes two character variables to read in this data: one character variable for NO and a second character variable for EXCEED. I guess for this case fortran recognizes both the comma and the space as delimiters, however I only want the comma as the delimiter.
When I open the files in excel, the columns are all correctly separated. That is for both files the column will look like NO EXCEED, without quotation marks (which is good). Only when I open the files using WordPad can I see the quotation marks for the 1st file.
The character variables are defined like:
character*12 A
How do I work around this problem or does the CSV file have to be changed? In order for fortran to process CSV files with character data, does the character data have to be put in quotation marks? If I have to change the CSV file what is the best method to do this? The files are bigger than 1 gig.
The 2nd CSV file is exactly the same as the 1st CSV file, except the 2nd file has more data and the character data does not have quotation marks. The CSV files are sent from third/fourth party and the data is sent as a favor so if it's possible I would like to resolve this problem on my own. I am programming with fortran 77 using Microsoft Visual Studio 2008.
I hope there is enough information, if not please tell me what is missing and I will supply. Thank you for your help.