@@ -115,18 +115,29 @@ module csv_module
115
115
! >
116
116
! Constructor.
117
117
118
- subroutine initialize_csv_file (me ,quote ,delimiter ,verbose )
118
+ subroutine initialize_csv_file (me ,quote ,delimiter ,&
119
+ enclose_strings_in_quotes ,&
120
+ enclose_all_in_quotes ,&
121
+ verbose )
119
122
120
123
implicit none
121
124
122
125
class(csv_file),intent (out ) :: me
123
- character (len= 1 ),intent (in ),optional :: quote ! ! note: can only be one character
124
- character (len= 1 ),intent (in ),optional :: delimiter ! ! note: can only be one character
126
+ character (len= 1 ),intent (in ),optional :: quote ! ! note: can only be one character
127
+ character (len= 1 ),intent (in ),optional :: delimiter ! ! note: can only be one character
128
+ logical ,intent (in ),optional :: enclose_strings_in_quotes ! ! if true, all string cells
129
+ ! ! will be enclosed in quotes.
130
+ logical ,intent (in ),optional :: enclose_all_in_quotes ! ! if true, *all* cells will
131
+ ! ! be enclosed in quotes.
125
132
logical ,intent (in ),optional :: verbose
126
133
127
- if (present (quote)) me% quote = quote
128
- if (present (delimiter)) me% delimiter = delimiter
129
- if (present (verbose)) me% verbose = verbose
134
+ if (present (quote)) me% quote = quote
135
+ if (present (delimiter)) me% delimiter = delimiter
136
+ if (present (enclose_strings_in_quotes)) &
137
+ me% enclose_strings_in_quotes = enclose_strings_in_quotes
138
+ if (present (enclose_all_in_quotes)) &
139
+ me% enclose_all_in_quotes = enclose_all_in_quotes
140
+ if (present (verbose)) me% verbose = verbose
130
141
131
142
end subroutine initialize_csv_file
132
143
! *****************************************************************************************
@@ -1127,8 +1138,8 @@ end subroutine read_line_from_file
1127
1138
!
1128
1139
! ### Example
1129
1140
! ````Fortran
1130
- ! type(csv_file) :: f
1131
- ! character(len=:),allocatable :: s
1141
+ ! type(csv_file) :: f
1142
+ ! character(len=:),allocatable :: s
1132
1143
! type(csv_string),dimension(:),allocatable :: vals
1133
1144
! s = '1,2,3,4,5'
1134
1145
! vals = f%split(s,',')
0 commit comments