libsim  Versione6.3.0

◆ csv_record_init()

subroutine, private file_utilities::csv_record_init ( type(csv_record), intent(inout)  this,
character(len=*), intent(in), optional  record,
character(len=1), intent(in), optional  csep,
character(len=1), intent(in), optional  cquote,
integer, intent(out), optional  nfield 
)
private

Initialise a csv_record object.

If the record is provided in input, the object is used for decoding a record read from a file (csv_record_getfield methods), if record is not provided, then the object will be used for coding a csv record (csv_record_addfield methods), for the successive write on file. It is possible to specify nonstandard characters for delimiting and grouping fields, default comma (,) and double quote ("). In case of decoding, it is possible to obtain in output the number of fields in the record, but this will take extra computing time. As an alternative, the csv_record_end method can be used when extracting each field. Warning: the csv_record class does not handle csv records that extend on different lines.

Parametri
[in,out]thisobject to be initialised
[in]recordcsv record to be interpreted, if not provided, it means we want to code a csv record for output
[in]csepfield separator character, default , (comma)
[in]cquotefield grouping character, default " (double quote); it is usually used when a field contains comma or blanks
[out]nfieldnumber of fields in the record

Definizione alla linea 513 del file file_utilities.F90.

513 LOGICAL, INTENT(in), OPTIONAL :: force_quote
514 
515 CALL csv_record_addfield(this, t2c(field, ''), force_quote=force_quote)
516 
517 END SUBROUTINE csv_record_addfield_real_miss
518 
519 
522 SUBROUTINE csv_record_addfield_double(this, field, form, force_quote)
523 TYPE(csv_record),INTENT(INOUT) :: this
524 DOUBLE PRECISION,INTENT(IN) :: field
525 CHARACTER(len=*),INTENT(in),OPTIONAL :: form
526 LOGICAL, INTENT(in), OPTIONAL :: force_quote
527 
528 IF (PRESENT(form)) THEN
529  CALL csv_record_addfield(this, trim(to_char(field, form)), force_quote=force_quote)
530 ELSE
531  CALL csv_record_addfield(this, t2c(field), force_quote=force_quote)
532 ENDIF
533 
534 END SUBROUTINE csv_record_addfield_double
535 
536 
540 SUBROUTINE csv_record_addfield_double_miss(this, field, force_quote)
541 TYPE(csv_record),INTENT(INOUT) :: this
542 DOUBLE PRECISION,INTENT(IN) :: field
543 LOGICAL, INTENT(in), OPTIONAL :: force_quote
544 
545 CALL csv_record_addfield(this, t2c(field, ''), force_quote=force_quote)
546 
547 END SUBROUTINE csv_record_addfield_double_miss
548 
549 
Functions that return a trimmed CHARACTER representation of the input variable.
Restituiscono il valore dell'oggetto in forma di stringa stampabile.

Generated with Doxygen.