write.FileList: Import a batch of files to the source table

Description Usage Arguments Details Value Author(s) Examples

View source: R/FilesFun.R

Description

If importing a single file to the project, you can do it by clicking import button in the Files Tab. Sometimes, you want to import a batch of files quickly, you can do it by command. write.FileList can be used to import a batch of files into the source table in the *.rqda file. addFilesFromDir can add all files from a directory into *.rqda.

Usage

1
2
3
write.FileList(FileList, encoding = .rqda$encoding, con = .rqda$qdacon, ...)

addFilesFromDir(dir, pattern = "*.txt$")

Arguments

FileList

A list. Each element of the list is the file content, and the names(FileList) are the respective file name.

encoding

Don't change this argument.

con

Don't change this argument.

dir

Path of a directory where plain files are located.

pattern

Argument passed to list.files; only files matching this pattern are imported.

...

... is not used.

Details

The file content will be converted to UTF-8 character before being written to *.rqda. The original content can be in any suitable encoding, so you can inspect the content correctly; In other words,the better practices is to used the corresponding encoding (you can get a hint by localeToCharset function) to save the imported files.

Value

This function is used for the side-effects. No value is return.

Author(s)

Huang Ronggui

Examples

1
2
3
4
5
6
## Not run: 
Files <- list("File name one"="content of first File.",
              "File name two"="content of the second File.")
write.FileList(Files) ## Please launch RQDA(), and open a project first.

## End(Not run)

RQDA documentation built on May 2, 2019, 3:24 p.m.