Description Usage Arguments Details Author(s) References Examples
After parsing a .dct
dictionary file with the
dct.parser
function, it may be useful to
convert that file to a schema that can be used by
csvkit, a useufl Pyton tool for working with csv
files. In particular, this creates a schema that allows
you to convert a fixed width format file to a csv file.
1 | csvkit.schema(x, columns.to.match = NULL)
|
x |
Your input |
columns.to.match |
By default, if the input file is
the output of |
This function will write a csv file to your current
working directory. It takes the name of the original
parsed dictionary file appended with .csv by default
(which is stored as an attribute of the data.frame
created during the dictionary parsing step). If that
attribute is not present, it prompts the user for a file
name, which should be provided not quoted.
Ananda Mahto
csvkit's in2csv
documentation:
https://csvkit.readthedocs.org/en/latest/scripts/in2csv.html
1 2 3 4 5 6 7 8 9 10 11 | ## Read an example dictionary file
data(sampleDctData)
## Write the data to a dictionary file
currentdir <- getwd()
setwd(tempdir())
writeLines(sipp84fp_dct, "sipp84fp.dct")
sipp84_R_dict <- dct.parser("sipp84fp.dct")
list.files(pattern=".dat|.dct|.csv")
csvkit.schema(sipp84_R_dict)
list.files(pattern=".dat|.dct|.csv")
setwd(currentdir)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.