Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to read multiple Excel/CSV file and write to another file.

Solved Go to solution

How to read multiple Excel/CSV file and write to another file.

Explorer
 
1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to read multiple Excel/CSV file and write to another file.

@Gaurav Jain

There are many ways to do it, however, assuming that you would use NiFi, you could build a flow starting with GetFile processor pointing to a folder where you have all your CSV files. Follow with MergeContent and PutFile processors.

Otherwise, it could be even simpler and without NiFi. If your files have the same structure and each has a header, then a simple shell script can extract the header from one file and remove the header from the others and just merge the content. You can easily do all this using sed unix command.

3 REPLIES 3

Re: How to read multiple Excel/CSV file and write to another file.

I also have the same query as want the excel data to be inserted into my database but unable to find one.

Re: How to read multiple Excel/CSV file and write to another file.

Master Guru

@Gaurav Jain

Please provide full use case and examples. It is difficult to provide assistance without the details. The more the better.

Re: How to read multiple Excel/CSV file and write to another file.

@Gaurav Jain

There are many ways to do it, however, assuming that you would use NiFi, you could build a flow starting with GetFile processor pointing to a folder where you have all your CSV files. Follow with MergeContent and PutFile processors.

Otherwise, it could be even simpler and without NiFi. If your files have the same structure and each has a header, then a simple shell script can extract the header from one file and remove the header from the others and just merge the content. You can easily do all this using sed unix command.

Don't have an account?
Coming from Hortonworks? Activate your account here