2013-04-08 63 views
-1

我想通過在shell腳本中結合三個或更多個xls來構建xls,例如在下面的示例中,我有A.csv,B.csv和C.csv,並且我希望所有三個單獨的xls ..將不同的csv結合到單個xls中

File name:,A.csv,,,,,, 
Load summary:,,,,,,, 
,"(A) 
Records received in CIF file","(B) 
Records loaded in CIF table (temp_card)","(C) 
Cramer count (Card)","(A - B) 
Records failed to load into CIF","(B - C) 
Records failed to load into Cramer",Cramer Load Success %,Overall Load Success % 
,14606,14606,14606,0,0,100,100 



File name:,B.csv,,,,,, 
Load summary:,,,,,,, 
,"(A) 
Records received in CIF file","(B) 
Records loaded in CIF table (temp_card)","(C) 
Cramer count (Card)","(A - B) 
Records failed to load into CIF","(B - C) 
Records failed to load into Cramer",Cramer Load Success %,Overall Load Success % 
,14606,14606,14606,0,0,100,100 


File name:,C.csv,,,,,, 
Load summary:,,,,,,, 
,"(A) 
Records received in CIF file","(B) 
Records loaded in CIF table (temp_card)","(C) 
Cramer count (Card)","(A - B) 
Records failed to load into CIF","(B - C) 
Records failed to load into Cramer",Cramer Load Success %,Overall Load Success % 
,14606,14606,14606,0,0,100,100 

我怎麼能做到這一點..

+1

請指出預期的輸出以及迄今爲止嘗試過的內容。 – fedorqui 2013-04-08 08:05:33

+0

你在你的問題中混合了.csv和.xls,請指出你想要的輸出文件格式(csv是文本文件,xls是二進制格式)。 – 2013-04-08 08:09:28

+0

我希望這三個csvs作爲不同的工作表在單個xls中說xls用於不同元素A,B和C的組合報告 – sandeep7289 2013-04-08 08:12:08

回答

0

什麼簡單的東西:

#!/bin/bash 
cat A.csv B.csv c.csv > ABC.xls 

這應該做到這一點。如果你期待別的東西,那麼在QS中提到。