Parsing

Nu offers the ability to do some basic parsing.

How to parse an arbitrary pattern from a string of text into a multi-column table.

  1. > cargo search shells --limit 10 | lines | parse "{crate_name} = {version} #{description}" | str trim

Output

  1. ───┬──────────────┬─────────────────┬────────────────────────────────────────────────────────────────────────────────
  2. # │ crate_name │ version │ description
  3. ───┼──────────────┼─────────────────┼────────────────────────────────────────────────────────────────────────────────
  4. 0 shells "0.2.0" Sugar-coating for invoking shell commands directly from Rust.
  5. 1 pyc-shell "0.3.0" Pyc is a simple CLI application, which allows you to perform shell commands in
  6. cyrillic and other a
  7. 2 ion-shell "0.0.0" The Ion Shell
  8. 3 sheldon "0.6.6" Fast, configurable, shell plugin manager.
  9. 4 nu "0.44.0" A new type of shell
  10. 5 git-gamble "2.3.0" blend TCR + TDD to make sure to develop the right thing, babystep by babystep
  11. 6 martin "1.0.0-alpha.0" Blazing fast and lightweight PostGIS vector tiles server
  12. 7 fnm "1.29.2" Fast and simple Node.js version manager
  13. 8 remote_shell "2.0.0" remote shell written by rust.
  14. 9 sauce "0.6.6" A tool for managing directory-specific state.
  15. ───┴──────────────┴─────────────────┴────────────────────────────────────────────────────────────────────────────────