LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General > LinuxQuestions.org Member Intro
User Name
Password
LinuxQuestions.org Member Intro New to LinuxQuestions.org? Been a long time member but never made a post? Introduce yourself here.

Notices

Reply
 
Search this Thread
Old 09-05-2008, 04:42 AM   #1
jonnymorris
LQ Newbie
 
Registered: Sep 2008
Posts: 10

Rep: Reputation: 0
Unix amateur


Hi,

I'm one who has used unix and saw that it was good, but struggles with the more complex aspects of shell scripts, perl, etc. I've come here initially seeking help with some CSV file text manipulation that really needs to be automated. I imagine a line or two of cunning sed should do the trick, but have never used sed myself.
 
Old 09-05-2008, 07:46 AM   #2
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
Using age-old UNIX tools like sed is all well and good, but I would personally recommend using Python as a general, everyday-use scripting tool. If you have a CSV, it's really something as simple as:
Code:
import sys

file_to_open = sys.argv[1]
f = open(file_to_open, 'r')

file_buffer = f.read()
file_buffer = file_buffer.split(',')
In that example, you will be given a list (file_buffer) of all of the values that was previously one, big, comma-separated block o' text.

My other reason for suggesting Python, is that it is super easy to learn, powerful as all-get-out, and what knowledge you learn in Python (the same could be said for Perl and sed, however) is portable to other systems (Linux, Mac OS X, Windows, etc.)
 
Old 09-05-2008, 08:36 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Welcome to LQ!!
The tool depends on what you want to do, n'est-ce pas?

I suggest you start a new thread with a specific question. (Maybe you already did....)
 
  


Reply

Tags
csv, manipulation, sed, text


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
LXer: Fldigi and amateur radio on Linux LXer Syndicated Linux News 1 02-13-2007 10:55 PM
Total amateur help with CB54G2 (MS-6835) Boltz101 Linux - Wireless Networking 1 07-14-2006 10:23 PM
amateur intro.. scoton LinuxQuestions.org Member Intro 2 03-09-2006 07:39 PM
Amateur Radio Forum webwolf70 LQ Suggestions & Feedback 3 09-26-2004 05:56 AM
Good way for amateur to test skills? Linus VanPelt Linux - General 3 02-13-2004 07:44 PM


All times are GMT -5. The time now is 09:05 AM.

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