Skip to content

Instantly share code, notes, and snippets.

View stardigits's full-sized avatar

stardigits stardigits

View GitHub Profile
@stardigits
stardigits / csv_header.sh
Created November 20, 2018 20:07
Transpose CSV string header with line number in Bash
# Example:
# echo "one,two,three,four,five" | csv_header
# Result:
# 1 one
# 2 two
# 3 three
# 4 four
# 5 five
@stardigits
stardigits / csv2json.js
Last active November 19, 2018 11:12
Node / JS: Convert CSV string to JSON with series by columns
/*
Convert using terminal STDIN & Pipe
Example:
cat files.csv | node csv2json.js
*/
var lines="";
process.stdin.setEncoding('utf8');
process.stdin.on('readable', () => {
var chunk = process.stdin.read();
if (chunk !== null) {
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
<link rel="stylesheet" href="https://unpkg.com/chota@latest">
</head>
<body>
<div id="app">
</div>
</body>
<script>