# Sine wave ASCII plot in NuShell with color using match (correct syntax for guards)
# written by Grok with some manual syntax corrections and changing the colors to use nushell colors
const PI = 3.14159265359
const WIDTH = 180
const HEIGHT = 30Get the SHA256 Hast for a list of files. This can be used to compare to the hast of a downloaded file.
nuls -f d:/work/tools | where name =~ '^nu'| sort-by modified | select fullname |
each {|file| {fullname: $file.fullname, hash: (open $file.fullname --raw | hash sha256)} } | collectFrom Roseeta Code Merge and aggregate datasets Task
-
Merge and aggregate two datasets as provided in .csv files into a new resulting dataset.
-
Use the appropriate methods and data structures depending on the programming language.
-
Use the most common libraries only when built-in functionality is not sufficient.
- Note Either load the data from the .csv files or create the required data structures hard-coded.
| # config.nu | |
| # | |
| # Installed by: | |
| # version = "0.102.0" | |
| # | |
| # This file is used to override default Nushell settings, define | |
| # (or import) custom commands, or run any other startup tasks. | |
| # See https://www.nushell.sh/book/configuration.html | |
| # | |
| # This file is loaded after env.nu and before login.nu |
This will use the faa-wildlife-strikes.csv file from the VisiData demo. Calculate each species’ state-level percentages
let data = open faa-wildlife-strikes.csv
| where SPECIES !~ 'Unknown' and STATE != ''
let state = $datato filer on a date field do the following steps
- make sure the
import datetimeis in the .visidatarc file. - format the date column with
@to let visidata know it is a date column. - be in the column, and do a filter
z| - key in the command
DATE_FIELD_NAME > datetime.date(YYYY,M,D)
INCIDENT_DATE > datetime.date(2016,1,1)
Use FD to find a file and pipe it to Nushell's ls command to list information on the file.
fd -H -I -i -E 'Windows' -E 'Python' -E 'Steel*' -E '*ffice*' -E '*ire*' -E '*VS Code*' -E 'WindowsPowerShell' --glob '*posh*.exe' 'c:\' | lines | each {|file| nuls -f ($file |path dirname) | where name =~ ($file | path basename ) } | flattenfd -H -I -i -E 'Windows' -E 'Python' -E 'Steel*' -E '*ffice*' -E '*ire*' -E '*VS Code*' -E 'WindowsPowerShell' --glob '*posh*.exe' 'c:\'
I saw on Hacker News for another programming lanuage. I wanted to get the forecast for my area using Nushell.
- I used Grok to get the code for my location.
http get https://api.weather.gov/gridpoints/FFC/32,107/forecast | from json |
get properties.periods |