@@ -199,7 +199,7 @@ end subroutine destroy_csv_file
199
199
! >
200
200
! Read a CSV file.
201
201
202
- subroutine read_csv_file (me ,filename ,header_row ,skip_rows ,status_ok )
202
+ subroutine read_csv_file (me ,filename ,header_row ,skip_rows ,status_ok , delimiter )
203
203
204
204
implicit none
205
205
@@ -208,6 +208,8 @@ subroutine read_csv_file(me,filename,header_row,skip_rows,status_ok)
208
208
logical ,intent (out ) :: status_ok ! ! status flag
209
209
integer ,intent (in ),optional :: header_row ! ! the header row
210
210
integer ,dimension (:),intent (in ),optional :: skip_rows ! ! rows to skip
211
+ character (len= 1 ),intent (in ),optional :: delimiter ! ! note: can only be one character
212
+ ! ! (Default is `,`)
211
213
212
214
type (csv_string),dimension (:),allocatable :: row_data ! ! a tokenized row
213
215
integer ,dimension (:),allocatable :: rows_to_skip ! ! the actual rows to skip
@@ -230,6 +232,7 @@ subroutine read_csv_file(me,filename,header_row,skip_rows,status_ok)
230
232
arrays_allocated = .false.
231
233
if (allocated (me% csv_data)) deallocate (me% csv_data)
232
234
if (allocated (me% header)) deallocate (me% header)
235
+ if (present (delimiter)) me% delimiter = delimiter
233
236
234
237
open (newunit= iunit, file= filename, status= ' OLD' , iostat= istat)
235
238
0 commit comments