LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 03-07-2005, 02:22 PM   #1
jterr02
LQ Newbie
 
Registered: Sep 2004
Location: dallas, texas
Distribution: mandrake 10.0, RH 9.0
Posts: 14

Rep: Reputation: 0
Culling Data from a CSV file to output in excel


I am trying to cull out all rows of a csv file that match a specific group of IPs, i.e.100.25.40.* for instance and out that to a file displayable in excel.

Assuming this requires sed and awk commands or Perl.

Any ideas on how to do this?
I need to get all the data form the files with rows matchign the IP $string.

Hoping to use Korn shell for this but open to other ideas.
 
Old 03-07-2005, 02:37 PM   #2
jterr02
LQ Newbie
 
Registered: Sep 2004
Location: dallas, texas
Distribution: mandrake 10.0, RH 9.0
Posts: 14

Original Poster
Rep: Reputation: 0
where i am right now

grep 10.25.40. cvs.file > cvs.out
This should give me a list of all the lines that contain 10.25.40.xxx

uniq -d cvs.out > cvs.out.uniq
This should result in a list of all lines that are repeated.

awk is the usual tool i think to pass this info on but need to bone up on it.
 
Old 05-19-2006, 04:58 AM   #3
pronoy
Member
 
Registered: Mar 2005
Location: india
Distribution: FC4, Debian Etch
Posts: 67

Rep: Reputation: 15
Guess you are trying to do:

awk '/10.25.40/ {print $0}' cvs.file | uniq -d > cvs.out.uniq
 
  


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
Sorting data in output file lluciano Linux - General 2 08-19-2005 10:37 AM
how to import MS-Excel sheet data using PHP dileepkk Programming 1 07-28-2004 02:23 PM
Shell script to read from csv file hendemeg Programming 1 05-11-2004 08:23 PM
csv to fixed-length file roballen Programming 0 03-11-2004 03:12 AM
CSV File AMMullan Programming 2 11-10-2003 12:49 AM


All times are GMT -5. The time now is 02:08 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration