datafort_io Module

DataFort I/O Module

This module provides I/O operations for data frames including CSV reading/writing and console output.

Functions

CSV Operations

  • df_write_csv(df, filename) - Export data frame to CSV file
  • df_read_csv(df, filename, has_headers) - Import CSV file into data frame

Console Output

  • df_write_console(df, unit) - Display data frame in console


Subroutines

private subroutine add_csv_column(df, data_strings, headers, col_index, has_headers)

Add a column with automatic type detection

Read more…

Arguments

Type IntentOptional Attributes Name
type(data_frame), intent(inout) :: df
character(len=*), intent(in), dimension(:) :: data_strings
character(len=*), intent(in), optional, dimension(:) :: headers
integer, intent(in) :: col_index
logical, intent(in) :: has_headers

public subroutine df_read_csv(df, filename, has_headers)

Import CSV file into data frame

Read more…

Arguments

Type IntentOptional Attributes Name
type(data_frame), intent(inout) :: df
character(len=*), intent(in) :: filename
logical, intent(in) :: has_headers

public subroutine df_write_console(df, unit)

Display data frame in console

Read more…

Arguments

Type IntentOptional Attributes Name
type(data_frame), intent(in) :: df
integer, intent(in), optional :: unit

public subroutine df_write_csv(df, filename)

Export data frame to CSV file

Read more…

Arguments

Type IntentOptional Attributes Name
type(data_frame), intent(in) :: df
character(len=*), intent(in) :: filename

private subroutine parse_csv_line(line, fields)

Parse a CSV line into fields

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: line
character(len=100), intent(out), allocatable :: fields(:)