Code Monkey home page Code Monkey logo

hahaconvert's Introduction

Install

git clone https://github.com/suiyuex/hahaconvert
cd hahaconvert

# 编译可执行程序
deno task compile
# 安装为cli
deno task install

#卸载cli
deno task uninstall

Usage

必须存在一个表头行,用于确定列的名称以及列的类型

默认情况下,表的第一行为表头行,表头行的下一行会被忽略,用于描述每列的行

导出的文件默认放在源文件同目录下 data/my.ods -> data/my.json

表头行格式!key[#type],如果以!开头则不会导出本列

#type可选, 类型默认为string

类型支持

  • int
  • float
  • bool
  • string
  • int[]
  • float[]
  • [] 字符串数组

数组分隔符为,

导出ods/xls/xlsx

不指定-f默认导出为json

help

hahaconvert export -h

导出为json

hahaconvert export -o ourDir path/to/file.ods

# -o 设置导出的目录

如果传入目录,会递归获取目录下所有*.ods, *.xls, *.xlsx文件

导出csharp文件

默认情况下,为了保持与c#的语法兼容,如果表格中某列的key为snake_case会被转换成camelCase

# -f 指定为 cs 是必须的
hahaconvert export -f cs sheets

# -csharp-ns 指定文件的命名空间,默认没有
# --csharp-suffix 指定类名/文件名后缀,默认为Config,也就是 Job.ods -> JobConfig.cs with class JobConfig
# --keep-case 不自动将snake_case转换成camelCase

img

hahaconvert's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.