question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can there be an option for a text only output?

I would like this:

Weather report: Broadstairs, United Kingdom
      .-.      Moderate rain
     (   ).    12-13 °C       
    (___(__)   ↘ 12 km/h      
   ‚‘‚‘‚‘‚‘    13 km          
   ‚’‚’‚’‚’    3.0 mm 

To become this:

Weather report: Broadstairs, United Kingdom
Summery: Moderate rain
Temp: 12-13 °C       
Wind: South East 12 km/h      
13 km   (I don't know what this is!)       
Rainfall: 3.0 mm 

Can it be done?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:13
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
exkccommented, Jan 5, 2021

A simple way to do it

curl 'wttr.in?0TF' 2>&1 |sed -E 's/^.{15}//'m

2reactions
EllainYangcommented, Dec 3, 2018

I don’t pretend for the best decision but in bash maybe something like this: curl wttr.in 2>&1 | grep -A 6 "Weather report" | sed '1,2d' |sed "s,\x1B\[[0-9;]*[a-zA-Z],,g"| sed -E 's/^.{15}//'

  1. curl wttr.in 2>&1 the main idea of this task is that curl send output to stderr(2), so to change output you need redirect it to stdout(1)
  2. grep -A 6 "Weather report" find the line with “Weather report” and shows 6 lines below (including our occurrence line)
  3. sed '1,2d' delete first two string
  4. sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" remove colors
  5. sed -E 's/^.{15}//' Erase first 15 symbols(seems like all ascii pictures that they have always 15 symbols length)

Here is my output: Sunny -8–2 °C
↑ 22 km/h
10 km
0.1 mm

Read more comments on GitHub >

github_iconTop Results From Across the Web

Text Plain Format - MuleSoft Documentation
The Text Plain format represents text as a string. ... Because the DataWeave (dw) output is a string, it is wrapped in quotation...
Read more >
Browser-like Reader Mode with text-only output
I've been experimenting with readability-cli (https://gitlab.com/gardenappl/readability-cli) combined with pandoc (https://pandoc.org/).
Read more >
Plain Text Output Options (PSPP) - GNU.org
PSPP can produce plain text output, drawing boxes using ASCII or Unicode line drawing characters. To produce plain text output, specify -o file...
Read more >
Simple Powershell: Output basic Text instead of formatted ...
There are a bunch of ways to do this but one way is to pick off what you want with a foreach-object cmdlet....
Read more >
Bash Scripting: How to Output and Format Text on Linux Shell
Output Text with Sound​​ This is a simple option of outputting text with a bell or alert. To do this, type the following...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found