INExlsxToSchema: Transform Spanish NSI fwf schema into an object of class...

Description Usage Arguments Value See Also Examples

View source: R/INExlsxToSchema.R

Description

INExlsxToSchema transforms an xlsx file in the Spanish NSI internal standard for fwf schemas into an object with class StfwfSchema.

This function reads an Excel file containing the schema of the fixed-width file to read according to the Spanish NSI internal standard, creates an intermediate xml file with the information of the schema, reads this xml file and constructs an object of class StfwfSchema. The intermediate xml file contains the following elements:

The Excel file must have a header in the second row (according to Spanish NSI internal standard)..

Usage

1
2
3
4
5
6
INExlsxToSchema(
  xlsxName,
  sheetToRead = 1,
  xmlName = NULL,
  regionName = "METADATOS"
)

Arguments

xlsxName

Complete name of the xlsx file containing the schema.

sheetToRead

Name or index of the sheet of the schema in the xlsx file.

xmlName

Complete name where the xml file is going to be written.

regionName

Region from the xlsx file containing the info about the number of rows.

Value

Return an object of class StfwfSchema.

See Also

INExlsxToXML INExmlToSchema

Examples

1
2
3
4
path <- 'inst/extdata'
xlsxName <- file.path(system.file('extdata', package = 'fastReadfwf'), 'dr_EESEadulto_2020.xlsx')
xmlName  <- file.path(system.file('extdata', package = 'fastReadfwf'), 'dr_EESEadulto_2020.xml')
stSchema <- INExlsxToSchema(xlsxName = xlsxName, xmlName = xmlName)

david-salgado/fastReadfwf documentation built on Dec. 25, 2021, 12:43 p.m.