merge_files: merge json files (or any kind of text files) from a directory

View source: R/utils.R

merge_filesR Documentation

merge json files (or any kind of text files) from a directory

Description

merge json files (or any kind of text files) from a directory

Usage

merge_files(
  INPUT_FOLDER,
  OUTPUT_FILE,
  CONCAT_DELIMITER = "\n",
  verbose = FALSE
)

Arguments

INPUT_FOLDER

a character string specifying a path to the input folder

OUTPUT_FILE

a character string specifying a path to the output file

CONCAT_DELIMITER

a character string specifying the delimiter to use when merging the files

verbose

either TRUE or FALSE. If TRUE then information will be printed in the console.

Details

This function is meant for json files but it can be applied to any kind of text files. It takes an input folder (INPUT_FOLDER) and an output file (OUTPUT_FILE) and merges all files from the INPUT_FOLDER to a single OUTPUT_FILE using the concatenation delimiter (CONCAT_DELIMITER).

Examples


## Not run: 
library(geojsonR)

merge_files(INPUT_FOLDER = "/my_folder/", OUTPUT_FILE = "output_file.json")

## End(Not run)

geojsonR documentation built on Jan. 12, 2023, 5:12 p.m.