Git Product home page Git Product logo

gc-excelviewer's Introduction

Excel Viewer

Powered by Wijmo, this extension provides read-only viewers for CSV files and Excel spreadsheets within the current Visual Studio Code workspace.

This extension requires Visual Studio Code 1.23.0 or greater, as it now uses the new Webview API.

This extension no longer requires access to an external CDN, which prevented it from being used behind a firewall. This version adds settings for controlling the display format of numeric columns in CSV files. It also includes fixes for compatibility with other CSV file extensions. See the changelog for details.

CSV Usage

For files with a .csv, .tsv, or .tab extension, use the explorer context menu or editor title menu to invoke the Open Preview command. The contents of the file will be displayed in a FlexGrid control, which supports sorting and filtering via its column headers.

Image

For .tsv and .tab files, a tab delimiter is assumed. For plain text files with different extensions, open the file in an editor and execute the CSV: Open Preview command from the command palette.

Excel Usage

For files with an .xlsx or .xlsm extension, use the explorer context menu or editor title menu to invoke the Open Preview command. The contents of the file will be displayed in a FlexSheet control. If multiple sheets are present, use the controls at the bottom of the view for navigation.

Image

Persistent Data

The extension automatically stores user customizations on a per-file, per-workspace basis. For CSV files, this includes column widths, sort/filter criteria, data types, format strings, and scroll bar positions. For Excel files, this includes the selected sheet index, sort/filter criteria, and scroll bar positions associated with that sheet only. As of version 2.0.16, if the column structure of a CSV file changes, any persistent data is ignored for that file. This fixes issues where new columns were not displayed unless the file was moved or renamed.

To discard persistent data for a CSV or Excel file, execute the command CSV: Clear Preview State. The preview will be refreshed automatically.

Since version 2.0.21 contains bug fixes that depend upon revised column structure, any persistent data for CSV/Excel files saved with earlier versions will be ignored.

Numeric Formatting

Version 2.1.22 added new settings for controlling the display format of numeric columns. By default, numeric formatting is enabled for CSV files, and the extension will examine the first row of data to determine which columns are numeric. The setting csv-preview.numberFormat specifies a .NET-style format string that controls the display type and significant digits for all numeric columns. This setting defaults to g2, which specifies two significant digits and does not display a thousands separator.

Set csv-preview.formatValues to false to turn off numeric formatting and treat all values as strings.

Since data types and format strings are persisted along with other column properties, you may need to run the CSV: Clear Preview State command to see the effects of changing the csv-preview.formatValues and csv-preview.numberFormat options.

Configuration

To change the default configuration settings for the Excel Viewer extension, edit the user or workspace settings as described here. The available settings are as follows:

Setting Type Default Value Description
csv-preview.separator string , (comma) Specifies the separator used in a CSV file.
csv-preview.quoteMark string " (double‑quote) Specifies the optional character used to surround individual values in a CSV file.
csv-preview.hasHeaders boolean true Specifies whether the first row in a CSV file represents column headers.
csv-preview.capitalizeHeaders boolean true Specifies whether column headers in CSV files are capitalized.
csv-preview.resizeColumns string none Specifies whether columns are automatically resized to fit the data for CSV files.
csv-preview.lineNumbers boolean false Specifies whether to display line numbers for CSV files.
csv-preview.commentCharacter string # Specifies the character used to mark comment lines in CSV files.
csv-preview.skipComments boolean false Specifies whether lines that begin with the comment character should be omitted from the CSV preview.
csv-preview.formatValues boolean true Specifies whether to format numeric values in CSV files, or to treat all values as strings.
csv-preview.numberFormat string g2 Specifies a .NET-style format string used to format numeric columns in CSV files.
csv-preview.theme string cleandark Specifies the Wijmo theme used to style the preview grid.
csv-preview.openStdin boolean false Specifies whether text piped to stdin is automatically opened as a CSV preview.

Any open CSV/Excel previews will automatically update to reflect the modified settings, except where noted in the previous section.

References

gc-excelviewer's People

Contributors

marcus-nl avatar schaveyt avatar

Watchers

 avatar  avatar  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.