Skip to content

AkselA/sh-array2csv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

array2csv

Convert a Bash array to CSV

Install

  1. Clone this repository
  2. Run install.sh in a command terminal.
    This will make array2csv.sh executable, copy it to /usr/local/bin/array2csv and test it by running a couple of small examples.

Usage

arr1=("Filename" "Codec" "Sample format" "Sample rate" 
      "02 New Feelings.m4a" "aac" "fltp" "44100"
      "01 Runny Mascara.m4a" "aac" "fltp" "44100")

# Notice that the script needs to be sourced, like this
. array2csv -a arr1[@] -n 4 -q -p -o "a.txt" -s "; "

# or this
source array2csv -a arr1[@] -n 4 -q -p -o "a.txt" -s "; "

# For further information on usage
. array2csv -h

Tested on OS X 10.11.6 and Bash 3.2.57

About

Convert bash array to csv file

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages