- Aug
- 2,212
- 100
I have a file, astronomy.txt, which is generated by doing;
The goal is to extract the following from astronomy.txt;
This is simple to do in PowerShell;
This is how to call it from TCC;
Joe
Ref: https://docs.microsoft.com/en-us/po...ell.utility/select-string?view=powershell-5.1
Ref: https://en.m.wikipedia.org/wiki/Lynx_(web_browser)
Code:
lynx -dump -nolist "https://www.timeanddate.com/astronomy/canada/london" > c:\utils\astronomy.txt
The goal is to extract the following from astronomy.txt;
Code:
Sun in London - Next 7 Days
Scroll right to see more
2018 Sunrise/Sunset Daylength Solar Noon
Jan Sunrise Sunset Length Difference Time Mil. km
Jan 14 7:53 am 5:14 pm 9:20:53 +1:36 12:34 pm (25.8°) 147.153
Jan 15 7:53 am 5:15 pm 9:22:33 +1:40 12:34 pm (26.0°) 147.162
Jan 16 7:52 am 5:17 pm 9:24:15 +1:42 12:34 pm (26.2°) 147.172
Jan 17 7:52 am 5:18 pm 9:26:01 +1:46 12:35 pm (26.4°) 147.182
Jan 18 7:51 am 5:19 pm 9:27:50 +1:49 12:35 pm (26.6°) 147.193
Jan 19 7:51 am 5:20 pm 9:29:42 +1:52 12:35 pm (26.8°) 147.205
Jan 20 7:50 am 5:22 pm 9:31:36 +1:54 12:36 pm (27.0°) 147.216
This is simple to do in PowerShell;
Code:
powershell -command "$f = type c:\utils\astronomy.txt | Select-String -Pattern 'Sun in London - Next 7 Days' -context 0,11; $f"
This is how to call it from TCC;
Code:
pshell /s "type c:\utils\astronomy.txt | Select-String -Pattern 'Sun in London - Next 7 Days' -context 0,11"
Joe
Ref: https://docs.microsoft.com/en-us/po...ell.utility/select-string?view=powershell-5.1
Ref: https://en.m.wikipedia.org/wiki/Lynx_(web_browser)