Hi Austin,

I think there are a couple of ways to do that:
1. UpdateRecord with CSVReader and CSVWriter, update a column with a
Record Path and Expression Language, e.g. Add a dynamic property,
key=/filename, value=${filename}
2. Use SpritText to sprit each CSV record into a FlowFile, then
combine ReplaceText to prepend, append or replace text to insert
filename, you can use Expression Language here, too

I recommend #1 above as it performs better than #2. It may take time
for you to get familiar with Record, Record path, Reader, Writer,
Schema ... etc, if you haven't played with those yet, but once you
know how it woks, you can apply the Record processing at various
processors.

Hope this helps,
Koji


On Wed, Jan 31, 2018 at 6:44 AM, Austin Duncan <[email protected]> wrote:
> all,
> I am trying to take a csv, add a column to it that contains the filename of
> the csv, and then insert that record into postgres using the
> putdatabaserecord processor. Any idea what would be the best way to go about
> doing this?
>
> --
> Austin Duncan
> Researcher
>
> PYA Analytics
> 2220 Sutherland Avenue
> Knoxville, TN 37919
> 423-260-4172

Reply via email to