I am trying to merge data from different .txt files (all files in the same directory) where file names are different but each file contains the same column names. Below is the script I am trying to use:
I want to insert a column in my combined file where * (it is a number in my file name which is unique for each file) can be listed as a reference to show from which file these rows are taken. Need help with this, please.
The code is working fine till ExtractedNames and I can see that the names are extracted from only .txt files. But then the Data command with map function is giving error.
Error in read.table(file = file, header = header, sep = sep, quote = quote, :
no lines available in input