Pentaho:如何将单个Excel文件拆分为多个Excel工作表输出 [英] Pentaho : How to split single Excel file to multiple excel sheet output

查看:716
本文介绍了Pentaho:如何将单个Excel文件拆分为多个Excel工作表输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一份员工详细信息列表.我想在单独的Excel工作表中拆分每个员工详细信息.我做了很多尝试,但仅使用Pentaho水壶就只能得到单独的Excel文件,而不是将所有工作表放在一个文件中.

I have a list of employee details. I want to split each employee detail in separate Excel sheet. I tried a lot but I get only separate Excel files alone, not all the sheets in a single file by using Pentaho kettle.

例如:

Raja    22 developer  25000
ravi    23 tester      2000
karthik 24 designer    4000 
Mani    28 developer  45000

每个员工的详细信息将需要在单个excel文件中使用单独的工作表.我已经与"MS excel writer"一起使用,但是没有用.

In that each employee details will need separate sheets in a single excel file. Already, I worked with "MS excel writer" but it did not work.

编辑

感谢您的宝贵答复,它的确很明确且更有用. :-)但是我需要您提供更多详细信息,如果我将年龄,技能,薪水列添加到获取变量中,则在运行作业后,我没有得到这三个字段的值,而是仅在每张纸上显示了它们的列名.我需要在每张纸上包括它们的列值

Thanks for your valuable reply,its really clear and more useful. :-) But i need one more detail from you,if i added age,skill ,salary columns into the get variables, after run the job ,i didn't get the values of these three fields only their column names shown in every sheet. I need to include their column values in each sheet

示例:表格1:(raja)

example : sheet 1 : (raja)

姓名年龄技能工资Raja 22开发人员25000

Name age skill salary Raja 22 developer 25000

第2页:(ravi)名称年龄技能工资ravi 23 tester 2000

sheet 2 :(ravi) Name age skill salary ravi 23 tester 2000

就像我需要生成每张纸一样,希望您能理解我的意思.您能帮我如何生成它吗?

Like that i need to generate each sheets,I hope you get my point. Can you please help me how to i generate that.

推荐答案

您需要将行(员工姓名)复制到内存中,然后将其循环到excel文件中以生成带有员工姓名的多个工作表.我已经在位置中上传了代码.您可以查看它.

You need to copy the rows (employee names) into memory and then loop it across the excel file to generate multiple sheets with employee names. I have uploaded the codes in this location. You can view it.

首先,我接受了excel输入,并使用复制行以生成结果"步骤将数据加载到内存中.

First of all, i took an excel input and used "copy rows to result" step to load the data to the memory.

在第二步中,循环内存中的所有数据,并将其跨excel文件写入.您可以通过启用将先前的结果复制到参数"来循环文件,并且对每一行执行"将对每一行运行.查看下面的图片:

In the Second Step, loop all the data in the memory and write it across the excel file. You can loop the file by enabling the 'copy previous results to parameter' and 'execute for every row' will run for every single row. Check the image below:

最后,当将文件写入excel文件(使用Excel Writer步骤)时,请确保每次上一行都来自上一个.步骤被插入到同一文件中.请检查下面的图像.

Finally when writing the files in an excel file (using Excel Writer Step) make sure that every time a row is coming from prev. step is getting inserted into the same file. Check the below image for this.

我已在驱动器中上传了示例代码.希望对您有所帮助:)

I have uploaded a sample code in drive. Hope it helps :)

这篇关于Pentaho:如何将单个Excel文件拆分为多个Excel工作表输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆