Python Forum
Grab and Parse a chunkc of text
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Grab and Parse a chunkc of text
#4
(Oct-07-2019, 02:16 PM)Gribouillis Wrote: Can you explain what the sed command does exactly here?

searches for a line that starts with Switch
Quote:sed /^Switch/


through an empty line
Quote:sed /^Switch/,/^$/


do not delete the match / deletes everything but the match
Quote:sed /^Switch/,/^$/!d



from the log called xxx.log
Quote:sed /^Switch/,/^$/!d xxx.log


grep just counts start of lines
Quote:sed /^Switch/,/^$/!d xxx.log | grep -c "^"


Thanks
SUM
Reply


Messages In This Thread
Grab and Parse a chunkc of text - by sumncguy - Oct-07-2019, 01:08 PM
RE: Grab and Parse a chunkc of text - by ichabod801 - Oct-07-2019, 02:08 PM
RE: Grab and Parse a chunkc of text - by sumncguy - Oct-07-2019, 03:39 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question [PyMuPDF] Grab all strings of a given size? Winfried 3 771 Dec-26-2023, 07:39 AM
Last Post: Pedroski55
  Can't stop keyboard listener to grab chars typed inside CTk window Valjean 9 1,537 Sep-25-2023, 08:07 PM
Last Post: deanhystad
  [SOLVED] [ElementTree] Grab text in attributes? Winfried 3 1,706 May-27-2022, 04:59 PM
Last Post: Winfried
  Screen capture opencv - grab error Kalman15 1 1,709 Jan-27-2022, 12:22 PM
Last Post: buran
  How can I parse a text file? Mike Ru 13 9,306 May-31-2017, 07:39 PM
Last Post: Mike Ru

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020