1
I have several files with data stored in text of fixed width. All files have a header with information about the data entity and a last line in FINALIZER format##########
Where ###########################################################################################################).
I am using read.fwf("caminho do arquivo", widths = c(4,2,80), col.names = c("exercicio", "codigo", "nome"), strip.white = TRUE, skip = 1)
of the R language and with it I can skip the header, but the FINALIZER line I am not able to "jump".
Note that widths
and col.names
are specific to each file (there are 27 files in total).
I’m looking for a way to:
Or not processing the line starting with "FINALIZER" before importing or importing; or
Delete the row that contains FINALIZER even if it is "split" into several columns. For example, in the file ORGAO.TXT, whose first field has 4 characters, the second has 2 and the third has 80, FINALIZER would be divided into FIN, AL, IZADOR0000000037, in the three columns.