Python Forum
More elegant way to remove time from text lines.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
More elegant way to remove time from text lines.
#7
There is Python friendly version of sed - sd. So it can be written as:

> sd -p '\[.*\]' '' test
-p flag is preview i.e. it will not change the file but you can see the result. If it is as expected flag can be omitted and actual change made
Pedroski55 likes this post
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Messages In This Thread
RE: More elegant way to remove time from text lines. - by perfringo - Apr-25-2021, 03:18 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Elegant way to apply each element of an array to a dataframe? sawtooth500 5 215 28 minutes ago
Last Post: deanhystad
  Is there a more elegant way to concatenate data frames? db042190 3 870 Jun-13-2023, 05:08 PM
Last Post: snippsat
  How to remove footer from PDF when extracting to text jh67 3 4,862 Dec-13-2022, 06:52 AM
Last Post: DPaul
  How to remove patterns of characters from text aaander 4 1,084 Nov-19-2022, 03:34 PM
Last Post: snippsat
  Editing text between two string from different lines Paqqno 1 1,287 Apr-06-2022, 10:34 PM
Last Post: BashBedlam
  Extracting Specific Lines from text file based on content. jokerfmj 8 2,869 Mar-28-2022, 03:38 PM
Last Post: snippsat
  raspberry use scrolling text two lines together fishbone 0 1,422 Sep-06-2021, 03:24 AM
Last Post: fishbone
  Want to remove the text from a particular column in excel shantanu97 2 2,094 Jul-05-2021, 05:42 PM
Last Post: eddywinch82
  how to connect mysql from txt 1 line goes good but not all lines in text kingceasarr 4 2,824 Mar-24-2021, 05:45 AM
Last Post: buran
  Assistance with running a few lines of code at an EXACT time nethatar 5 3,167 Feb-24-2021, 10:43 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

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