Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created on
02-09-2022
05:54 AM
- last edited on
04-21-2026
01:01 AM
by
GrazittiAPI
I have many zip files each containing a csv file. The header of the csv file contain fields and some field names have space between words e.g "field one" instead of "field_one" which is the one in the database.
Please, what is the optima method to change the csv field names to match the ones in the database.
NOTE: I am using MSSQL as the DB. And my NIFI implementation is
1) GetFile : from a repository that contain zip files of very large size
2)UnpackContent: to extract the csv from the zipped file
3) PutDabaseRecord: to persist the csv data into db because of its large size.
Thank you for your kind help.
Created 02-09-2022 08:11 PM
You can use a QueryRecord processor before the PutDatabaseRecord.
You can add a relation to the QueryRecord processor with the following associated query:
select
"field one" as field_one,
"field two" as field_two,
"field three" as field_three
from flowfile
In the query above you can reference one field names using double-quotes if they have spaces. You can specify an alias for that column, which is the field name that will be used in the output.
Cheers,
Andre
Created 02-09-2022 08:11 PM
You can use a QueryRecord processor before the PutDatabaseRecord.
You can add a relation to the QueryRecord processor with the following associated query:
select
"field one" as field_one,
"field two" as field_two,
"field three" as field_three
from flowfile
In the query above you can reference one field names using double-quotes if they have spaces. You can specify an alias for that column, which is the field name that will be used in the output.
Cheers,
Andre