Skip to content

davidburil/fixedwidth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
david.oliveira
Feb 2, 2022
8464507 · Feb 2, 2022

History

26 Commits
Jan 13, 2020
Sep 22, 2019
Feb 2, 2022
Jan 13, 2020
Jan 13, 2020
Jan 13, 2020

Repository files navigation

Infer Column Widths of a Fixed-Width Text File

A fixed-width file use a fixed column width for each column (though not all columns necessarily have the same width) and pads the remaining space on the left or on the right, usually with spaces:

   287540 Smith  Jones  Accountant         $55,000
   204878 Ross   Betsy  Senior Accountant  $66,000
   208417 Arthur Wilbur CEO               $123,000

Parsing a fixed-width file can be difficult. Either, the user has to know the column widths in advance and pass that to a parsing method, or the method has to infer the widths of the columns.

This package Go propose automated infer the columns.

Example

github.com/davidburil/fixedwidth-example


Project inspired by blog post at dev.to

About

Infer Column Widths of a Fixed-Width Text File

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages