Ced, 0.2.2
Ced is a csv editor interface.
** Program option **
<FILE | SCRIPT>
FILE to import. FILE is given as an argument not an flag option.
If a given file ends with .ced extension the file will be executed as
a script not csv data.
--version, -v
Print version info.
--help, -h
Print a help message
--command, -c <Command String>
Execute given commands without entering a shell mode. Each command can be
separated by a semi colon(;).
--confirm, -C
Confirm when command triggers write option.
--schema, -s <SCHEMA_FILE>
Import a schema file. This sets force option by default. Use shema inside
a command for detailed usage.
--nolog, -n
Do not print logs of commands.
* Shell commands
version, v
Print version information
help, h
Print help texts
import, i <HAS_HEADER : boolean>{Optional} <LINE_ENDING>{Optional}
Import a csv file into ced's virtual data. Import file can be sent as
first argument from terminal. You can feed an argument to decide if given
csv has header or not, the default value is "true".
Feed LINE_ENDING to read a specific file format.
- CR
e.g)
import file_name.csv
import file_name.csv false
import mac_file.csv true CR
import-raw, ir <HAS_HEADER: boolean>{Optional} <LINE_ENDING>{Optional}
Import a csv file into ced's virtual array. This sets csv value as array
mode. Within array mode, duplicate columns are allowed but limiters are
disabled.
Feed LINE_ENDING to read a specific file format.
- CR
e.g)
import-raw file_name.csv
ir mac_file.csv true CR
execute, ex <FILE : String>
Execute a file's content as command sequence.
e.g.)
execute commands.ced
export, x <FILE : String>
Export ced's virtual data into a file. This will create a new file if given
file doesn't exit. Existing contents of the file will be truncated.
e.g.)
export file_name
write, w <CACHE : bool>{Optional, Default=true}
Write ced's virtual data into a source file. Previous file's content will
be cached in temporary directory. You can disable this behaviour with
optional argument.
Temporary directory path is retrieved with rust standard library's temp_dir
method and depend on platforms.
e.g.)
write true
write false
print, p <VIEWER COMMAND>{Optional}
Print current ced's virtual data. If CED_VIEWER is set, print will utilizie
it for printing. You can also feed optional argument for custom viewer
e.g)
print
print tidy-viewer
print-cell, pc <COORD: usize,column> <MODE : String>{Optional}
Print a cell's data. There are modes for printing which are
- simple ( default )
- v, verbose
- d, debug
e.g)
print-cell 0,count
pc 2,1 debug
print-row, pr <ROW NUMBER> <VIEWER>{Optional}
Print a row. Viewer is optional and will use default formatting if
CED_VIEWER is not set.
e.g)
pr 0
pr 2 cat
print-column, pl <COLUMN_NAME>{Optional} <MODE>{Optional}
Print a column's information. Modes are following
- simple ( default )
- verbose,v
- debug,d
Will print names of columns with empty arguments
e.g)
pl
pl 0
pl column_name
pl col debug
create, c <COLUMN_NAMES>{Delimiter=space}
Create columns without types. Names should be separated by spaces.
e.g)
create a b c d e
create id address name
create ' id ' ' "HED" ' 'WOW '
add-row, ar <Index: usize>{Optional} <Row: array>{Optional,Delimiter=comma}
Add a new row into a given index. Empty arguments will trigger interactive
loop for data input.
e.g)
ar
ar 5
ar 2 a,b,c,d,e
add-column, ac <COLUMN_NAME: string>
<INDEX: usize>{Optional}
<TYPE: text|number>{Optional}
<PLACEHOLDER: String>{Optional}
Add a new column. Placeholder should accord with given type.
e.g)
ac address
ac id 2
ac count 3 number
ac dead 4 text false
edit, e <COORDINATE: (usize,usize)> <VALUE: string>
Edit a cell with given coordinate and value. Second argument can also be a
name of the column.
**Syntax Caveat**
- Coordinate is separated by comma
- surplus whitespaces will be merged to a single whitespace.
- Use quote to include literal white space in between
e.g.)
e 0,2 hello world
e 4,address 'rhode island'
edit-row, er <INDEX: usize> <Values: Array>{Delimiter=comma}
Edit a row with given values. Edit-row without a second argument will
trigger interactive edit mode. The default value of interactive mode is
original cell's value.
e.g)
er 2
er 3 a,b,c,d
edit-row-multiple, erm <START_INDEX: usize>{Optional} <END_INDEX: usize>{Optional}
Edit rows from given index. Start index is 0 by default and end index is row count by default.
e.g)
erm
erm 2
erm 2,5
edit-column, ec <COLUMN: column> <Value: String>
Edit column's value with given value.
e.g)
ec 1
ec count
ec dead false
delete-row, dr <INDEX: usize>
Delete a given row.
e.g)
dr 0
dr 3
delete-column, dc <COLUMN: column>
Delete a given column.
e.g)
dc 2
dc count
rename-column, rc <COLUMN: column> <NEW_NAME: string>
Rename a given column's name to a new name. New name cannot be exsiting
name or number.
e.g)
rc count index
rc dead alive
move, move-row, m <ORIGINAL: usize> <TARGET: usize>
Move a row from an original index to a target index.
e.g)
m 0 5
m 3 10
move-column, mc <Original: any> <TARGET: usize>
Move a column from original to target index
e.g)
mc 0 5
mc count 2
limit, l <COLUMN: column>{Optional} <Attributes: Array> <OVERRIDE: bool>
Set limiter for column with interactive prompt. You can directly pass
limiter attributes if you want.
The limiter's attributes are followed
- Column name { Mandatory }
- Column type ( Either "Text" or "Number" ) { Mandatory }
- Default value { Empty-able }
- Variants { Empty-able }
- Pattern { Empty-able }
- Force Update { Empty-able }
e.g)
limit
limit 'column_name,type,default,variant,pattern,true'
limit-preset, lp <Column: Any> <Preset Name: String>
Set limiter from preset. You can define presets in $HOME/.ced_preset.csv or
%APPDATA%/.ced_preset.csv
Format of preset file is same with schema file but first value is
preset_name instead of column_name.
There are built-in presets which are
- text
- number
- float
- email
- date
- time
- url
e.g)
limit-preset column email
lp column url
schema, s <FILE> <FORCE>
Read a schema file. Second argument is whether to force update or not.
e.g)
s file_name_to_read false
s new_file true
schema-export, se <FILE>
Export current virtual data's schema to a given file
e.g)
se file_to_export
schema-init, si <FILE>{Optional,default=ced_schema.csv}
Initiate a file with default schema headers
e.g)
si
si file_to_create_as_schema
undo, u
Undo a previous command
redo, r
Redo an undid command
history, y
Print history of commands maxium count of history is decided by environment variable "CED_HISTORY_CAPACITY"
quit, q
Quit from a ced editor