Learn R Programming

seqRFLP (version 1.0.1)

file.cat: Copy or concatenate files to one.

Description

This function could be used to concatenate the files in the given directory.

Usage

file.cat(dir = NULL, appendix = ".fas", file = NULL)

Arguments

dir
A string name the directory where files to be concatenated exist.
appendix
The appendix that files to be concatenated have.
file
The file name of the result to be save to.

Value

Copy all the contents of the files having the matched appendix to one file.

Details

Any plain text files that match the appendix could be concatenate or copy to one file.

References

None.

See Also

See Also raw2Fas for copying all different fasta file contents to one.

Examples

Run this code

#### file.cat() example
cat(
">No305",
"NTTCGAAAAACACACCCACTACTAAAANTTATCAGTCACT",
file = "dna1.fas", sep = "\n")
cat(
">No304",
"ATTCGAAAAACACACCCACTACTAAAAATTATCAACCACT",
file = "dna2.fas", sep = "\n")
cat(
">No305",
"NTTCGAAAAACACACCCACTACTAAAANTTATCAGTCACT",
file = "dna3.fas", sep = "\n")

file.cat(dir = getwd(), appendix = ".fas", file = "total")

unlink("dna1.fas")
unlink("dna2.fas")
unlink("dna3.fas")
unlink("total.fas")

Run the code above in your browser using DataLab