Sponsored Content
Top Forums Shell Programming and Scripting Using sed to remove a column from a CSV Post 302912499 by Franklin52 on Friday 8th of August 2014 03:02:34 PM
Old 08-08-2014
Quote:
Originally Posted by Don Cragun
Which is more simply written as:
Code:
sed 's/[^,]*, //' file

Indeed Smilie
This User Gave Thanks to Franklin52 For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed csv remove conditionally

Hello, I have many csv file, but I would like to delete lines with some values in a column conditionally. My example look like this, ex1e, ex2g, ex39, pasg, ssg, mrlc, pc, kb, coop -112, -53, -177, 64, 62, 71, 1, 487, 20 -101, -61, -53, 0, 32767, 51, 0, ... (6 Replies)
Discussion started by: Jae
6 Replies

2. Shell Programming and Scripting

Remove text from a csv file using sed

I am trying to remove the ita from this file: "1234ita","john","smith" "56789ita","jim","thomas" the command i am using is: sed '/^ita/d' infile.csv > outfile.csv it is running but doing nothing, very rarely use sed so trying to learn it any help would be appreciated (2 Replies)
Discussion started by: Pablo_beezo
2 Replies

3. Shell Programming and Scripting

Sed or awk script to remove text / or perform calculations from large CSV files

I have a large CSV files (e.g. 2 million records) and am hoping to do one of two things. I have been trying to use awk and sed but am a newbie and can't figure out how to get it to work. Any help you could offer would be greatly appreciated - I'm stuck trying to remove the colon and wildcards in... (6 Replies)
Discussion started by: metronomadic
6 Replies

4. Shell Programming and Scripting

Remove line feed from csv file column

Hi All, My requirement is to remove line (3 Replies)
Discussion started by: r_t_1601
3 Replies

5. Shell Programming and Scripting

Remove line feed from csv file column

Hi All, i have a csv file . In the 7th column i have data that has line feed in it. Requirement is to remove the line feed from the 7th column whenever it appears There are 11 columns in the file C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11 The value in C7 contains line feed ( Alt + Enter ),... (2 Replies)
Discussion started by: r_t_1601
2 Replies

6. UNIX for Dummies Questions & Answers

Use sed on column (csv) file if data in colmns is greater > than?

I have a data file that has 14 columns. I cannot use awk or perl but sed is installed on my host. I would like to delete a line if fields 10, 11 or twelve is greater than 999.99. How is this done using sed? :wall: sed '/^*,*,*,*,*,*,*,*,*,*,*,*,*,*,/d' infile 1 2 3 4 ... (2 Replies)
Discussion started by: Chris Eagleson
2 Replies

7. Shell Programming and Scripting

Sort, sed, and zero padding date column csv bash scripting

Hello people, I am having problem to sort, sed and zero padding of column in csv file. 7th column only. Input of csv file: 1,2,3,4,5,6,4/1/2010 12:00 AM,8 1,2,3,4,5,6,3/11/2010 9:39 AM,8 1,2,3,4,5,6,5/12/2011 3:43 PM,8 1,2,3,4,5,6,12/20/2009 7:23 PM,8 Output:... (5 Replies)
Discussion started by: sean1357
5 Replies

8. Shell Programming and Scripting

Remove the values from a certain column without deleting the Column name in a .CSV file

(14 Replies)
Discussion started by: dhruuv369
14 Replies

9. Shell Programming and Scripting

Need a piece of shell scripting to remove column from a csv file

Hi, I need to remove first column from a csv file and i can do this by using below command. cut -f1 -d, --complement Mytest.csv I need to implement this in shell scripting, Whenever i am using the above command alone in command line it is working fine. I have 5 files in my directory and... (3 Replies)
Discussion started by: Samah
3 Replies
Image::ExifTool::Import(3pm)				User Contributed Perl Documentation			      Image::ExifTool::Import(3pm)

NAME
Image::ExifTool::Import - Import CSV and JSON database files SYNOPSIS
use Image::ExifTool::Import qw(ReadCSV ReadJSON); $err = ReadCSV($csvFile, \%database); $err = ReadJSON($jsonfile, \%database); DESCRIPTION
This module contains routines for importing tag information from CSV (Comma Separated Value) and JSON (JavaScript Object Notation) database files. EXPORTS
Exports nothing by default, but ReadCSV and ReadJSON may be exported. METHODS
ReadCSV / ReadJSON Read CSV or JSON file into a database hash. Inputs: 0) CSV file name. 1) Hash reference for database object. 2) Optional flag to set '-' values to undef in the database. (Used for deleting tags.) 3) [ReadJSON only] Optional character set for converting Unicode escape sequences in strings. Defaults to "UTF8". See the ExifTool Charset option for a list of valid settings. Return Value: These functions return an error string, or undef on success and populate the database hash with entries from the CSV or JSON file. Entries are keyed based on the SourceFile column of the CSV or JSON information, and are stored as hash lookups of tag name/value for each SourceFile. AUTHOR
Copyright 2003-2011, Phil Harvey (phil at owl.phy.queensu.ca) This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
Image::ExifTool(3pm) perl v5.12.4 2011-03-12 Image::ExifTool::Import(3pm)
All times are GMT -4. The time now is 07:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy