Sponsored Content
Top Forums UNIX for Advanced & Expert Users Help in Deleting columns and Renaming Mutliple columns in a .Csv File Post 302607994 by mahi_mayu069 on Friday 16th of March 2012 12:05:31 AM
Old 03-16-2012
@SolarMax:- Thank you for the inputs... But i want to delete 3rd and 14th field and then i want the following Field headers are to renamed

Code:
m2239max, m2239min, m2239avg, m100016509avg, m100019240max, metric3min, m100019240avg

The Code u provided will onlt delete and prints the columns but i will not rename the filed headers.

Columns deletion and Field header renaming should happen at single Go with in a script. Hope it is clear

let me know if any clarification required.

Thanks!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Deleting specific columns from a file

Hi Friends, I want to delete specific columns from a file. Say my file content is as follows: "1","a","ww1",1234" "2","b","wwr3","2222" "3","c","erre","3333" Now i want to delete the column 2 and 4 from this file. That is I want the file content to be: "1","ww1" "2","wwr3"... (11 Replies)
Discussion started by: premar
11 Replies

2. Shell Programming and Scripting

deleting rows & columns form a csv file

Hi , I want to delete some rows & columns from file. can someone please help me on this? Regards. (2 Replies)
Discussion started by: code19
2 Replies

3. Shell Programming and Scripting

no of columns in csv file

Hi, I would like to know how can I find the number of columns in each line in a csv file. I have a csv file wiht comma separated an dhas 10000 line in it. I want to verify the number of columns in each line. is there any way to find it out using awk or any other commands? Thanks.... (2 Replies)
Discussion started by: McLan
2 Replies

4. Shell Programming and Scripting

Deleting columns from CSV file

Hi All, Am working on perl script which should delete columns in existing CSV file. If my file is : AA,BB,CC,DD 00,11,22,33 00,55,66,77 00,99,88,21 AA,BB... are all my headers can come in any order (e.g AA,CC,BB...) and rest are values. I want to delete column CC... Can anybody help... (2 Replies)
Discussion started by: darshakraut
2 Replies

5. Shell Programming and Scripting

Deleting columns by list or file

Dear specialists out there, please help a poor awk newbie: I have a very huge file to process consisting of 300000 columns and 1500 rows. About 20000 columns shall be deleted from that file. So it is clear, that I can't do this by writing down all the columns in an awk command like $1, $x etc.... (5 Replies)
Discussion started by: flxms
5 Replies

6. UNIX for Advanced & Expert Users

Unix Bash: substitute columns in .csv using other .csv columns

Hi All, I have two .csv's input.csv having values as (7 columns) ABC,A19907103,ABC DEV YUNG,2.17,1000,2157,07/07/2006 XYZ,H00213850,MM TRUP HILL,38.38,580,23308,31/08/2010 output.csv having (25 columns) A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y... (4 Replies)
Discussion started by: abhivyas
4 Replies

7. Shell Programming and Scripting

Deleting all the fields(columns) from a .csv file if all rows in that columns are blanks

Hi Friends, I have come across some files where some of the columns don not have data. Key, Data1,Data2,Data3,Data4,Data5 A,5,6,,10,, A,3,4,,3,, B,1,,4,5,, B,2,,3,4,, If we see the above data on Data5 column do not have any row got filled. So remove only that column(Here Data5) and... (4 Replies)
Discussion started by: ks_reddy
4 Replies

8. Shell Programming and Scripting

Compare 2 csv files by columns, then extract certain columns of matcing rows

Hi all, I'm pretty much a newbie to UNIX. I would appreciate any help with UNIX coding on comparing two large csv files (greater than 10 GB in size), and output a file with matching columns. I want to compare file1 and file2 by 'id' and 'chain' columns, then extract exact matching rows'... (5 Replies)
Discussion started by: bkane3
5 Replies

9. Shell Programming and Scripting

Match columns from two csv files and update field in one of the csv file

Hi, I have a file of csv data, which looks like this: file1: 1AA,LGV_PONCEY_LES_ATHEE,1,\N,1,00020460E1,0,\N,\N,\N,\N,2,00.22335321,0.00466628 2BB,LES_POUGES_ASF,\N,200,200,00006298G1,0,\N,\N,\N,\N,1,00.30887539,0.00050312... (10 Replies)
Discussion started by: djoseph
10 Replies

10. UNIX for Advanced & Expert Users

Replace columns in .csv using other .csv columns

Hi, I have 2 csv files with 15 000 lines, which looks like this: Daily.csv "CODE","BRAND","DESIGNER","SIZE","TYPE","GENDER","SET","DESCRIPTION","IMAGE","COST","WEIGHT","MSRP","UPC" "M-1001","212","Caroline Her","1.7 oz","EDT... (4 Replies)
Discussion started by: olivieraz
4 Replies
Class::Field(3pm)					User Contributed Perl Documentation					 Class::Field(3pm)

NAME
Class::Field - Class Field Accessor Generator SYNOPSIS
package Thing; use Class::Field qw'field const'; field 'this'; field 'list' => []; field 'map' => {}; field 'that', -init => '$self->setup_that'; field 'circular_ref' => -weaken; const 'answer' => 42; DESCRIPTION
Class::Field exports two subroutines, "field" and "const". These functions are used to declare fields and constants in your class. Class::Field generates custom code for each accessor that is optimized for speed. FUNCTIONS
o field Defines accessor methods for a field of your class: package Example; use base 'Parent'; use Class::Field qw'field const'; field 'foo'; field bar => []; sub lalala { my $self = shift; $self->foo(42); push @{$self->{bar}}, $self->foo; } The first parameter passed to "field" is the name of the attribute being defined. Accessors can be given an optional default value. This value will be returned if no value for the field has been set in the object. o const const bar => 42; The "const" function is similar to <field> except that it is immutable. It also does not store data in the object. You probably always want to give a "const" a default value, otherwise the generated method will be somewhat useless. NOTE
This code was taken directly out the Spiffy module for those people who just want this functionality without using the rest of Spiffy. AUTHOR
Ingy dA~Xt Net <ingy@cpan.org> COPYRIGHT
Copyright (c) 2006, 2008, 2009. Ingy dA~Xt Net. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See <http://www.perl.com/perl/misc/Artistic.html> perl v5.10.1 2009-12-10 Class::Field(3pm)
All times are GMT -4. The time now is 09:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy