Quantcast
Channel: Pentaho Community Forums
Viewing all articles
Browse latest Browse all 16689

Getting each file name as a field when reading several files in Microsoft Excel input

$
0
0
Hi!

So I have a folder with files from different sources that I need to combine and process.
They all share the same field structure and name convention, so I am using one single input step and a regular expression to read them all.
But the problem is that I need to identify the source of each line, and there is no way to know where they come from once I append them.
Having one step per source is not an option because there are many sources and they vary from day to day.

Example:
I have these files:
Quote:

Daily_Src1_20180517.xlsx
Daily_Src2_20180517.xlsx
Daily_Src4_20180517.xlsx
Daily_Src5_20180517.xlsx
That have this structure:
Quote:

Field1,Field2,Field3
aaaaaa,aaaaaa,aaaaaa
aaaaaa,aaaaaa,aaaaaa
And I want to read them with one single step and get something like this:
Quote:

Field1,Field2,Field3,Source
aaaaaa,aaaaaa,aaaaaa,Daily_Src1_20180517.xlsx
aaaaaa,aaaaaa,aaaaaa,Daily_Src1_20180517.xlsx
aaaaaa,aaaaaa,aaaaaa,Daily_Src1_20180517.xlsx
bbbbbb,bbbbbb,bbbbbb,Daily_Src2_20180517.xlsx
....
Is there a way to do this?


Thank you

Viewing all articles
Browse latest Browse all 16689

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>