@@ -199,7 +199,7 @@ end subroutine destroy_csv_file
199199! >
200200! Read a CSV file.
201201
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 )
203203
204204 implicit none
205205
@@ -208,6 +208,8 @@ subroutine read_csv_file(me,filename,header_row,skip_rows,status_ok)
208208 logical ,intent (out ) :: status_ok ! ! status flag
209209 integer ,intent (in ),optional :: header_row ! ! the header row
210210 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 `,`)
211213
212214 type (csv_string),dimension (:),allocatable :: row_data ! ! a tokenized row
213215 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)
230232 arrays_allocated = .false.
231233 if (allocated (me% csv_data)) deallocate (me% csv_data)
232234 if (allocated (me% header)) deallocate (me% header)
235+ if (present (delimiter)) me% delimiter = delimiter
233236
234237 open (newunit= iunit, file= filename, status= ' OLD' , iostat= istat)
235238
0 commit comments