Code Monkey home page Code Monkey logo

pipe2excel's Introduction

Pipe To Excel

pipe2excel sends the contents of STDIN or files of arguments to Excel as CSV to Microsoft Excel.

  • The each value of the csv is inserted as a string.
    • Only matching /^\-?[1-9]\d*(\.\d*[1-9])?$/, as a number
  • The encoding of the CSV is detected automatically whether it is written in UTF8 or the encoding of the current codepage.

How to use

OLE-MODE (Supported only Windows)

C:\> pipe2excel foo.csv bar.csv
C:\> type foo.csv | pipe2excel

It starts Microsoft Excel.

Non-OLE (Both Windows and Linux Ok)

C:\> pipe2excel -o foo.xlsx foo.csv

It does not start Microsoft Excel. It creates foo.xlsx statically.

Options

  • -f string Field Sperator (default ",")
  • -o string Save to file and quit immediately without EXCEL.EXE
  • -v Show version

Source CSV data (sample)

image

Destinate Excel data (sample)

image

history

  • v0.5.2 (Feb 19,2022)
    • Fix package dependency problems
    • Move or copy some packages into internal directory
    • Change package owner to hymkor
  • v0.5.1 (May 28,2021)
    • Support Linux as platform (but required -o option always)
    • (#1) Fix the panic on reading CSV from STDIN and using -o
  • v0.5.0 (Aug 08,2018)
    • When -o FILENAME is given, use "tealeg/xlsx" instead of "go-ole/go-ole"
    • Remove options -s and -q. Their features are enabled with -o.
  • v0.4.0 (Aug 05,2018)
    • Add -f option to set field seperator
    • Do not treat as string when the value is a negative integer.
  • v0.3.0 (Jul 11,2018)
    • Fix leak release COM
    • Print help if no arguments and stdin is not redirected
  • v0.2.0 (Jul 1,2018)
    • Only matching /^[1-9]\d*(\.\d*[1-9])?$/, as a number
  • v0.1.0 (Jul 1,2018)
    • Set cell as a string
    • Detect encoding utf8 or codepage automatically and remove -u option
    • Add -v option to show version
  • v0.0.1 (Jul 1,2018)
    • prototype

pipe2excel's People

Contributors

hymkor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

pipe2excel's Issues

Panic from STDIN with -o

$ type 13keta.csv
123456789012345,A,B,C
$ pipe2excel.exe -o 13keta.xlsx < 13keta.csv
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x20 pc=0xe24960]

goroutine 1 [running]:
github.com/tealeg/xlsx.(*Sheet).AddRow(...)
        C:/Users/zetamatta/go/pkg/mod/github.com/tealeg/[email protected]/sheet.go:52
main.(*SendCsvToXlsx).Send(0xc00001e580, 0xc0000402c0, 0x4, 0x4, 0x0, 0x0)
        C:/Users/zetamatta/goes/pipe2excel/toxlsx.go:32 +0x80
main.parseCsvReader(0xeab5a8, 0xc000040280, 0xeacf78, 0xc00001e580, 0xc000040280, 0x2e)
        C:/Users/zetamatta/goes/pipe2excel/main.go:51 +0x1c4
main.parseCsvFile(0xe6eda6, 0x1, 0xeacf78, 0xc00001e580, 0x0, 0x0)
        C:/Users/zetamatta/goes/pipe2excel/main.go:59 +0x234
main.main1(0xc00007fec8, 0x1, 0x1, 0x0, 0x0)
        C:/Users/zetamatta/goes/pipe2excel/main.go:98 +0x2cf
main.main()
        C:/Users/zetamatta/goes/pipe2excel/main.go:116 +0xc5
exit status 2
$ pipe2excel.exe -o 13keta.xlsx 13keta.csv
(no panics)

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.