csvplait 0.1

Interactive Tool for Manipulating CSV files
csvplait is a Python tool for manipulating CSV files either interactively or via script.

Usage

Interactive

python csvplait.py

 # Read in the CSV
 > read myfile.csv

 # Pretty print the table
 > pp

 # Drop first 2 columns
 > drop 0 1

 # Keep first five columns (labeled 0 to 4)
 > slice 0 4

 # this -> This
 > titleize 0

 # foo -> bar
 > strsub foo bar 0 2

 > write fixedup.csv


Script

You can easily create a script by writing out your history to a file:

> history script.csvplait

If you want to make your script even more programatic, you can add variables using a bash-like syntax:

 cat script.csvplait
read $FILENAME
drop 0
write $FILENAME.fixedup


Then, to invoke the script, run csvplait with the script as an argument as well as any environment variables that the script uses:

 python csvplait.py script.csvplait FILENAME=sept.csv

last updated on:
April 6th, 2012, 10:44 GMT
price:
FREE!
homepage:
github.com
license type:
The Apache License 2.0 
developed by:
Rick Harris
category:
ROOT \ Programming \ Version Control
csvplait
Download Button

In a hurry? Add it to your Download Basket!

user rating

UNRATED
0.0/5
 

0/5

Rate it!

Add your review!

SUBMIT