View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Aster
 
Posts: n/a
Default Upload multiple text files into 1 excel worksheet + put the filename as the first column in the worksheet

Hi,
I have multiple text files (*.txt) in 1 folder that I need to combine
in 1excel spreadsheet.
For each row in the text file, I would also need the filename of each
file to appear in my excel, ie. in the first column. The next column
will be the content.

Example of source files:
- File A01.TXT: Content:
Row 1....
Row 2...
- File A02.TXT: Content:
Row 1....
Row 2...

Combined Result in Excel:
Row Column A Column B
1 A01.txt Row 1...
2 A01.txt Row 2...
3 A02.txt Row 1...
4 A02.txt Row 2...

Thanks for any of u who can help