LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-28-2015, 10:03 PM   #1
hinesd1960
LQ Newbie
 
Registered: Jul 2013
Location: IL
Posts: 3

Rep: Reputation: Disabled
Question Command line to remove column 10 from a .csv file


Hello. I am new to Linux and am looking for a solution to remove column 10 from a .csv data file as this column is causing me problems. Any help would be appreciated.
Thank you!
 
Old 04-28-2015, 10:29 PM   #2
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
You can use the 'awk' command to do the job.
 
Old 04-28-2015, 10:46 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,533

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
Depends somewhat on what you mean by "delete". Do you want it removed completely - so you end up with one less field in each record ?. Or do you want to nullify the contents - so the number of fields remains the same ?.
If the former, "cut" would probably be quickest, and has almost no learning curve. For the latter, "awk", but it is a full language so requires some effort if you don't already know it.
 
Old 05-11-2015, 12:19 AM   #4
hinesd1960
LQ Newbie
 
Registered: Jul 2013
Location: IL
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thumbs up

Quote:
Originally Posted by veerain View Post
You can use the 'awk' command to do the job.
Thanks for the info. I will give this a try!
 
Old 05-11-2015, 12:21 AM   #5
hinesd1960
LQ Newbie
 
Registered: Jul 2013
Location: IL
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thumbs up

Quote:
Originally Posted by syg00 View Post
Depends somewhat on what you mean by "delete". Do you want it removed completely - so you end up with one less field in each record ?. Or do you want to nullify the contents - so the number of fields remains the same ?.
If the former, "cut" would probably be quickest, and has almost no learning curve. For the latter, "awk", but it is a full language so requires some effort if you don't already know it.
Yes, I want to remove the column completely. I do have a backup of the file.
Thank you.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove Column from .CSV using AWK command gaurvrishi Linux - Newbie 13 04-03-2015 11:14 AM
need shell command to wrap text &adjust column width (csv file ) Sankaran29 Linux - Newbie 6 12-17-2012 09:33 AM
[SOLVED] How to script csv editing? Remove rows from csv file that do not contain certain text ingram87 Linux - Software 9 08-03-2012 12:45 PM
Remove every fourth line from CSV file? briana.paige Linux - Newbie 3 08-12-2009 10:07 AM
file processing -- remove the first column of each line George2 Programming 7 11-19-2006 09:15 AM


All times are GMT -5. The time now is 04:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration