Sponsored Content
Top Forums Shell Programming and Scripting Merge *.csv files, each in separate sheets Post 302742497 by cero on Tuesday 11th of December 2012 06:21:22 AM
Old 12-11-2012
With sheet you mean a worksheet in MS-Excel? csv (Comma-Seperated-Values or Character-Separated-Values) is a file format that does not support a construct called sheet. Excel is an application you can use to view and edit .csv files, but you can use any editor/viewer/pager to do so.
If you need multiple csv-files on different Excel-worksheets you'll have to use an Excel-file (.xls or .xlsx) to store them.
Why not perl? It has good libraries for this task and to my knowledge is the most used tool to handle Excel-files in scripts.

Last edited by cero; 12-11-2012 at 07:29 AM.. Reason: Typos
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Add multiple .csv files as sheets to an excel file in unix.

Hi, I am using Solaris 8. My script outputs 4 .csv files. Currently I am SFTPing the files and creating a new excel file with the 4 files as sheets. Can anyone suggest ways to do this in UNIX ? Thanks, David. (2 Replies)
Discussion started by: libin4u2000
2 Replies

2. Shell Programming and Scripting

How to create a CSV File by reading fields from separate files

SHELL SCRIPT Hi, I have 3 separate files within a folder. Every File contains data in a single column like File1 contains data mayank sushant dheeraj File2 contains DSA_AT MG_AT FLAT_09 File3 contains data 123123 232323 (2 Replies)
Discussion started by: mayanksargoch
2 Replies

3. Shell Programming and Scripting

Merge 2 csv files with awk

I have 2 files pipe delimted and want to merge them based on a key e.g file 1 123$aaa$yyy$zzz 345$xab$yzy$zyz 456$sss$ttt$foo 799$aaa$ggg$dee file 2 123$hhh 345$ddd 456$xxx 888$zzz so if the key is the first field, and the result should be the common key between file 1 and 2 (6 Replies)
Discussion started by: loloAix
6 Replies

4. Shell Programming and Scripting

Merge 2 CSV files using sed

Help in writing a script using sed which updates fileOne with the contents from fileTwo Example: Contents of fileOne 1,111111 2,897823 3,235473 4,222222 Contents of fileTwo 1,111111,A,1,2 4,222222,A,2,2 5,374632,A,3,2 6,374654,A,4,2 Final File should be: 1,111111,A,1,2... (9 Replies)
Discussion started by: NewToSed
9 Replies

5. Shell Programming and Scripting

create separate files from one excel file with multiple sheets

Hi, I have one requirement, create separate files (".csv") from one excel file(xlsx) with multiple sheets. These ".csv" files are my source files. So anybody please suggest me the process. Thanks in Advance. Regards, Harris (3 Replies)
Discussion started by: harris
3 Replies

6. Shell Programming and Scripting

Write two csv files into one excel with multiple sheets

I have requirement to write two CSV files to one single excel with multiple sheets. Data present in the two files should sit in excel as different sheets. How can we achieve this using shell script? 1.csv 2. csv 1,2,3,4 5,6,7,8 XXXXX YYYYY Res.excel 1.csv data... (1 Reply)
Discussion started by: duplicate
1 Replies

7. Shell Programming and Scripting

Merge CSV files

I have lot of csv file collected from script like below : Name of files (some examples) there are thousands of it: 192.168.0.123_251_18796_1433144473.csv 192.168.0.123_251_18796_1433144772.csv 192.168.0.123_251_18796_1433145073.csv 192.168.0.123_251_18796_1433145372.csvContent of each... (5 Replies)
Discussion started by: rk4k
5 Replies

8. UNIX for Dummies Questions & Answers

Merge two csv files using column name

Hi all, I have two separate csv files(comma delimited) file 1 and file 2. File 1 contains PAN,NAME,Salary AAAAA5467D,Raj,50000 AAFAC5467D,Ram,60000 BDCFA5677D,Kumar,90000 File 2 contains PAN,NAME,Dept,Salary ASDFG6756T,Karthik,ABC,450000 QWERT8765Y,JAX,CDR,780000... (5 Replies)
Discussion started by: Nivas
5 Replies

9. Programming

Perl script to merge cells in column1 which has same strings, for all sheets in a excel workbook

Perl script to merge cells ---------- Post updated at 12:59 AM ---------- Previous update was at 12:54 AM ---------- I am using below code to read files from a dir and print to excel. open(my $in, '<', $file) or die "Could not open file: $!"; my $rowCount = 0; my $colCount = 0;... (11 Replies)
Discussion started by: Jack_Bruce
11 Replies

10. UNIX for Beginners Questions & Answers

Merge the three csv files as one according to first coloumn.

I have three files with similar pattern i need to merge all the coloumns side by side from all three files according to the first coloumn example as shown below I mentioned 5 coloumns only in example but i have around 15 coloumns in each file. file1: Name,Samples,Error,95RT,90RT... (4 Replies)
Discussion started by: Raghuram717
4 Replies
Excel::Template::Plus(3pm)				User Contributed Perl Documentation				Excel::Template::Plus(3pm)

NAME
Excel::Template::Plus - An extension to the Excel::Template module SYNOPSIS
use Excel::Template::Plus; my $template = Excel::Template::Plus->new( engine => 'TT', template => 'greeting.tmpl', config => { INCLUDE => [ '/templates' ] }, params => { greeting => 'Hello' } ); $template->param(location => 'World'); $template->write_file('greeting.xls'); DISCLAIMER
This is the very first release of this module, it is an idea that I and Rob Kinyon (the author of Excel::Template) had discussed many times, but never got around to doing. This is the first attempt at bring this to reality, it may change radically as it evolves, so be warned. DESCRIPTION
This module is an extension of the Excel::Template module, which allows the user to use various "engines" from which you can create Excel files through Excel::Template. The idea is to use the existing (and very solid) excel file generation code in Excel::Template, but to extend its more templatey bits with more powerful options. The only engine currently provided is the Template Toolkit engine, which replaces Excel::Template's built in template features (the LOOP, and IF constructs) with the full power of TT. This is similar to the module Excel::Template::TT, but expands on that even further to try and create a more extensive system. You can use this module to create Excel::Template-compatible XML files using one of the supported engines. For example, with the TT engine you could create a Excel::Template XML file like: <workbook> <worksheet name="[% worksheet_name %]"> [% my_cols = get_list_of_columns %] <row> [% FOR col = my_cols %] <bold><cell>[% col %]</cell></bold> [% END %] </row> [% FOR my_row = get_list_of_objects %] <row> [% FOR col = my_cols %] <cell>[% my_row.$col %]</cell> [% END %] </row> [% END %] </worksheet> </workbook> Your TT template thus creates a XML file suitable to handing over to Excel::Template for processing. Excel::Template::Plus simplifies the template-creation and handing-over process. Future engine/plans include: Pure Perl This would allow you to write you Excel::Template files using Perl itself which would then output the XML for Excel::Template to consume. This would be modeled after the recently released Template::Declare module perhaps. TT Plugins/Macros/Wrappers This is basically anything which will make the TT engine easier to write templates for. I have experimented with some of these things, but I was not happy with any of them enough to release them yet. HTML::Template Excel::Template's templating features are based on HTML::Template, but the HTML::Template plugins and other goodies are not compatible. This engine would bring those things to Excel::Template. METHODS
new (%options) This method basically serves as a factory for creating new engine instances (for which Excel::Template::Plus::TT is the only one currently). The only parameter that it requires is engine, all other parameters are passed onto the engine's constructor (see the individual docs for more details on what is required). meta Access to the metaclass. BUGS
All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT. ACKNOWLEDGEMENTS
This module came out of several discussions I had with Rob Kinyon. AUTHOR
Stevan Little <stevan@iinteractive.com> COPYRIGHT AND LICENSE
Copyright 2007-2010 by Infinity Interactive, Inc. <http://www.iinteractive.com> This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-05-06 Excel::Template::Plus(3pm)
All times are GMT -4. The time now is 08:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy