Sponsored Content
Full Discussion: Append Header in CSV file
Top Forums Shell Programming and Scripting Append Header in CSV file Post 302361114 by Tuxidow on Monday 12th of October 2009 09:18:54 AM
Old 10-12-2009
Plz post the error you are getting... and also please make sure to keep more clarity while posting...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How can I add a header to a csv file

I have a csv file which has no header. the file has 15 fields and needs to go out with a header of 8 fields. The header content needs to have some variables and some fixed that i have set up: variable header fields OUTFILE_YEAR=`date '+%y'` DATE=`date '+%d%m%y'` TIME=`date '+%H:%M:%S'`... (6 Replies)
Discussion started by: Pablo_beezo
6 Replies

2. Shell Programming and Scripting

I want to append data to same .csv file.

I have a script which has to be scheduled to run 3 times a day. My script picks the required fields from logfile and stores the data in a.csv file. Sample data. my logfile contain: 0097A,0374D,100903,1519,00000606191 0097A,C88RA,100903,0724,00000606105 So the output of first execution... (3 Replies)
Discussion started by: shrima.pratima
3 Replies

3. Shell Programming and Scripting

Add header to a .csv file

Hi, I am trying to add a header record to all the .csv files in a directory. I am using the below sed commnad sed -i '1 i \abc,sam,xyz,tip,pep,rip' xyz.csv but this is not adding the header and I am not getting any error,pls tell me if any thing is wrong in the code. Thanks, Shruthi (2 Replies)
Discussion started by: shruthidwh
2 Replies

4. UNIX for Dummies Questions & Answers

Merge all csv files in one folder considering only 1 header row and ignoring header of all others

Friends, I need help with the following in UNIX. Merge all csv files in one folder considering only 1 header row and ignoring header of all other files. FYI - All files are in same format and contains same headers. Thank you (4 Replies)
Discussion started by: Shiny_Roy
4 Replies

5. UNIX for Dummies Questions & Answers

append column and row header to a file in awk script.

Hi! Is there a way to append column and row header to a file in awk script. For example if I have Jane F 39 manager Carlos M 40 system administrator Sam F 20 programmer and I want it to be # name gend age occup 1 Jane F 39 manager 2 Carlos M ... (4 Replies)
Discussion started by: FUTURE_EINSTEIN
4 Replies

6. Shell Programming and Scripting

[Solved] Append an header to a tab delimited file

Dear All, I would like to find an automatic way to add a given code which belong to a class at the end of the column , for example this is my input file: 0610009O20Rik V$VMYB_01 310 (+) 1 0.971 v-Myb V$EVI1_04 782 (-) 0.763 0.834 Evi-1 V$ELK1_02 1966 (-) 1 0.984 Elk-1... (4 Replies)
Discussion started by: paolo.kunder
4 Replies

7. Shell Programming and Scripting

Is there a way to append both at header and footer of a file

currently I've a file Insert into CD_CARD_TYPE (CODE, DESCRIPTION, LAST_UPDATE_BY, LAST_UPDATE_DATE) Values ('024', '024', 2, sysdate); Insert into CD_CARD_TYPE (CODE, DESCRIPTION, LAST_UPDATE_BY, LAST_UPDATE_DATE) Values ('032', '032', 2, sysdate); ........ is it... (3 Replies)
Discussion started by: jediwannabe
3 Replies

8. Shell Programming and Scripting

How to get sqlplus column header once in csv file?

Hi All, Could anyoone please let me know how do I get sqlplus column header once in csv file Scripts are below: cat concreq.sh #!/bin/bash . $HOME/.profile while ; do sqlplus apps/pwd <<-EOF set lines 100 pages 100 col "USER_CONCURRENT_QUEUE_NAME" format a40; --set termout off... (5 Replies)
Discussion started by: a1_win
5 Replies

9. UNIX for Dummies Questions & Answers

Creating a csv file with header in UNIX

I have a flat file that contains dynamic list of variables like a=1 b=2 c=3 . .. z=26 I need to convert the above into a csv file having the format below: a,b,c,..,z 1,2,3,..,26 Please note, I do not want a comma separating the last variable. I tried to refer the post... (4 Replies)
Discussion started by: vkumbhakarna
4 Replies

10. Shell Programming and Scripting

Script to validate header in a csv file

Hi All; I am struggling to write a script that validates file header. Header file would be like below with TAB separated TRX # TYPE REF # Source Piece Code Destination Piece Code every time I need to check the txt file if the header was same as above fields if validation success... (6 Replies)
Discussion started by: heye18
6 Replies
Business::EDI::Spec(3pm)				User Contributed Perl Documentation				  Business::EDI::Spec(3pm)

NAME
Business::EDI::Spec - Object class for CSV-based U.N. EDI specifications SYNOPSIS
use Business::EDI::Spec; my $spec = Business::EDI::Spec->new('segment'); DESCRIPTION
CSV files originally from edi4r are included as part of Business::EDI. They are used to define the many different messages, segements, data elements, composite data elements, and codelists that are part of a given version of the U.N. specification. The CSV spec files are composed differently for the different structures defined. So we have to parse them differently. ==> Business/EDI/data/edifact/untdid/EDCD.d07a.csv # Composite Elements CompositeCode;label;pos;code;mandatory;def;[pos;code;mandatory;def;...] C001;TRANSPORT MEANS;010;8179;C;an..8;020;1131;C;an..17;030;3055;C;an..3;040;8178;C;an..17; C002;DOCUMENT/MESSAGE NAME;010;1001;C;an..3;020;1131;C;an..17;030;3055;C;an..3;040;1000;C;an..35; C004;EVENT CATEGORY;010;9637;C;an..3;020;1131;C;an..17;030;3055;C;an..3;040;9636;C;an..70; C001 => {label => 'TRANSPORT MEANS;010;8179;C;an..8;020;1131;C;an..17;030;3055;C;an..3;040;8178;C;an..17; ==> Business/EDI/data/edifact/untdid/EDED.d07a.csv # Data Elements code;def;class(?):label 1000;an..35;B;Document name 1001;an..3;C;Document name code 1003;an..6;B;Message type code 1000 => {label => 'an..35;B;Document name ==> Business/EDI/data/edifact/untdid/EDMD.d07a.csv # Messages MessageCode:x:rel:org:z:SegmentGroup;label;SegCode;mandatory;repeats;[SegCode;mandatory;repeats;...] APERAK:D:07A:UN::;Application error and acknowledgement message;UNH;M;1;BGM;M;1;DTM;C;9;FTX;C;9;CNT;C;9;SG1;C;99;SG2;C;9;SG3;C;9;SG4;C;99999;UNT;M;1 APERAK:D:07A:UN::SG1;SG01;DOC;M;1;DTM;C;99 APERAK:D:07A:UN::SG2;SG02;RFF;M;1;DTM;C;9 APERAK:D:07A:UN:: => {label => 'Application error and acknowledgement message', UNH;M;1; BGM;M;1; DTM;C;9;FTX;C;9;CNT;C;9;SG1;C;99;SG2;C;9;SG3;C;9;SG4;C;99999;UNT;M;1 ==> Business/EDI/data/edifact/untdid/EDSD.d07a.csv # Segments SegCode;label;pos;code;class;repeats[pos;code;class;repeats;...] ADR;ADDRESS;010;C817;C;1;020;C090;C;1;030;3164;C;1;040;3251;C;1;050;3207;C;1;060;C819;C;5;070;C517;C;5; AGR;AGREEMENT IDENTIFICATION;010;C543;C;1;020;9419;C;1; AJT;ADJUSTMENT DETAILS;010;4465;M;1;020;1082;C;1; ADR => {label => 'ADDRESS', 010;C817;C;1;020;C090;C;1;030;3164;C;1;040;3251;C;1;050;3207;C;1;060;C819;C;5;070;C517;C;5; ==> Business/EDI/data/edifact/untdid/IDCD.d07a.csv # Composites (interactive) E001 => {label => 'ADDRESS DETAILS;010;3477;M;an..3;020;3286;M;an..70;030;3286;C;an..70;040;3286;C;an..70;050;3286;C;an..70;060;3286;C;an..70;070;3286;C;an..70; ==> Business/EDI/data/edifact/untdid/IDMD.d07a.csv # Messages (interactive) MsgCode:x:rel:org:z:SegmentGroup;label;SegCode;mandatory;class;repeats;;[mandatory;class;repeats;...] IHCEBI:D:07A:UN::;Interactive health insurance eligibility and benefits inquiry and;UIH;M;1;MSD;M;1;SG1;C;9;SG2;C;1;UIT;M;1 IHCEBI:D:07A:UN::SG1;SG01;PRT;M;1;NAA;C;9;CON;C;9;FRM;C;9 IHCEBI:D:07A:UN::SG2;SG02;DTI;M;1;ICI;C;1;FRM;C;9;SG3;C;999 IHCEBI:D:07A:UN::SG3;SG03;BCD;M;1;HDS;C;9;DTI;C;1;PRT;C;9;FRM;C;9 IHCLME:D:07A:UN::;Health care claim or encounter request and response - interactive;UIH;M;1;MSD;C;1;PRT;C;9;NAA;C;9;CON;C;9;BLI;C;1;ITC;C;1;FRM;C;99;SG1;C;3;SG2;C;99;UIT;M;1 IHCLME:D:07A:UN::SG1;SG01;OTI;M;1;NAA;C;2 IHCLME:D:07A:UN::SG2;SG02;PSI;M;1;DNT;C;35 ==> Business/EDI/data/edifact/untdid/IDSD.d07a.csv # Segments (interactive) SegCode;label;pos;code;mandatory;repeats(?) AAI;ACCOMMODATION ALLOCATION INFORMATION;010;E997;M;20; ADS;ADDRESS;010;E817;C;1;020;E001;C;1;030;3164;C;1;040;3251;C;1;050;3207;C;1;060;E819;C;1;070;E517;C;1; AAI => {label => 'ACCOMMODATION ALLOCATION INFORMATION', pos => '010', E997;M;20; TO DO
Parsing for interactive specs. SEE ALSO
edi4r - http://edi4r.rubyforge.org Business::EDI AUTHOR
Joe Atzberger perl v5.12.4 2010-09-08 Business::EDI::Spec(3pm)
All times are GMT -4. The time now is 03:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy