Skip to content
Branch: master
Go to file
Code

Latest commit

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

README.markdown

Labeled Tab-Separated Value parser / manipulator for shell

What's this?

See http://ltsv.org/ and the following example:

#!/bin/bash
# or
#!/bin/ksh

. ./LTSV.sh

## Define a hash to store values
typeset -A hash
## Parse an LTSV in a string
LTSV_decode hash "foo:Foo	bar:Bar	baz:*baz*"
## Parse an LTSV read from STDIN
#LTSV_decode hash

echo "${hash[foo]}"
echo "${hash[bar]}"
echo "${hash[baz]}"

for key in "${!hash[@]}"; do
  echo "$key: ${hash[$key]}"
done

## Manipulate an LTSV from a hash
LTSV_encode hash

Requirements

  • bash or ksh (ksh93)

TODO

  • Add more test
  • Support zsh
  • LTSV_encode: Reject or escape TAB and CR character in values

About

Labeled Tab-Separated Value parser / manipulator for shell

Resources

License

Releases

No releases published

Languages

You can’t perform that action at this time.