The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
MEM=`ps v $PPID| grep -i db2 | grep -v grep| awk '{ if ( $7 ~ " " ) { print 0 } else hariza Shell Programming and Scripting 4 09-18-2008 03:56 AM
grep and fetching lines after grep arghya_owen Shell Programming and Scripting 2 07-16-2008 08:25 AM
how to exclude the GREP command from GREP yamsin789 UNIX for Advanced & Expert Users 2 10-05-2007 03:59 AM
How to grep kamathg Shell Programming and Scripting 2 08-06-2007 05:24 PM
Make grep -c display like grep -n? Jerrad Shell Programming and Scripting 2 08-25-2006 01:20 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-10-2009
eltinator eltinator is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 63
Grep Out of a CSV

Hi, I have a CSV file and would like to grep out a particular row of values. The CSV file looks something like...

"email", "data", "date", "other data", "blah", "NUMBER I WANT", "more stuff", and "more stuff"

The file has hundreds of lines and I basically just want the number after the 5th comma. If it helps any, the number is always preceded by the letter "E" Any help would be appreciated, thanks!
  #2 (permalink)  
Old 02-10-2009
timontt timontt is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 44
if just need to get col after 5th comma, try below

cat csvfile | awk -F, '{print $6}'

Thanks!
  #3 (permalink)  
Old 02-11-2009
eltinator eltinator is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 63
Awesome! One more thing I forgot to mention, the number I want is surrounded by "". How can I get rid of those quotation marks? Thanks so much!
  #4 (permalink)  
Old 02-11-2009
just4fundoit just4fundoit is offline
Registered User
  
 

Join Date: Jan 2009
Posts: 19
cat csvfile | awk -F, '{print $6}' |sed 's/"//g'
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:01 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0