Some of the files from PDL have text trailing the CSV portion of the file. This routine removes files from the end until a record that starts with a token of all integers is found. This is the order primary key. The bad file has been replaces with a cleaned CSV file having the original name.

replace_bad_csv_files(path, file_names, orig_prefix = "org")

Arguments

path

character vector of length one with the file path

file_names

character vector of the file names to be read

orig_prefix

character string with the prefix to be put on the renamed bad file.