Question: I have one folder with multiple text files that I add one text file to every day. All text files are in the same format and are pipe delimited. 

Is it possible to create code for excel that will automatically import the data from the multiple text files into one worksheet?

I found some code that would import all the text files from the folder, but only if I changed it all to comma delimited first. Also, I could not get it to update if I added files to the folder. 

Any help would be greatly appreciated!

Answer: 
Sounds like it'd be easiser to run a script to cycle thru all the files in the directory, create a new file composed of all the files' contents as new lines, and save that as a csv. something like:

```
import os

basedir='c://your_root_dir'
dest_csv="<path to wherever you want to save final csv>.csv"
dest_list=[]

for root, subs, files in  os.walk(basedir):
    for f in files:
        thisfile=open(basedir+f)
        contents=thisfile.readlines()
        dest_list.append(contents)

#all that would create a list containing the contents of all the files in the directory
#now we'll write it as a csv

f_csv=open(dest_csv,'w')
for i in range(len(dest_list)):
     f_csv.write(dest_list[i])
f_csv.close()

```

You could save a script like that somewhere and run it each day, then open the resulting csv in excel. This assumes that you want to get the data from each file in a particular directory, and that all the files you need are in one directory.
You can use Schema.ini ( <http://msdn.microsoft.com/en-us/library/ms709353(VS.85).aspx> ), Jet driver and Union query, with any luck.