Python Forum
Removing the unwanted data from a file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Removing the unwanted data from a file
#2
Could do something like this

string = 'family/Smallville, Robert & Mary/28134: Bioelectro healing - https://t.me/bioelectromagnetic_healing'
print(string)
new_string = string.split('-')
new_string = new_string[1].strip()
print(new_string)
Output:
family/Smallville, Robert & Mary/28134: Bioelectro healing - https://t.me/bioelectromagnetic_healing https://t.me/bioelectromagnetic_healing
jehoshua likes this post
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags
Download my project scripts


Reply


Messages In This Thread
RE: Removing the unwanted data from a file - by menator01 - Nov-14-2021, 01:07 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to remove unwanted images and tables from a Word file using Python? rownong 2 973 Feb-04-2025, 08:30 AM
Last Post: Pedroski55
Question Unwanted execution of unittest ThomasFab 9 4,696 Nov-15-2022, 05:33 PM
Last Post: snippsat
  HELP on Unwanted CSV Export Output | Using Selenium to Scrape soothsayerpg 0 1,887 Jun-13-2021, 12:23 PM
Last Post: soothsayerpg
  xml file creation from an XML file template and data from an excel file naji_python 1 2,980 Dec-21-2020, 03:24 PM
Last Post: Gribouillis
  How to save CSV file data into the Azure Data Lake Storage Gen2 table? Mangesh121 0 2,739 Jun-26-2020, 11:59 AM
Last Post: Mangesh121
  How to eliminate unwanted spaces Mohan 5 4,528 Jun-04-2020, 08:34 AM
Last Post: buran
  Removing Certain Numbers From File chascp 2 3,069 Feb-07-2020, 04:04 PM
Last Post: chascp
  Unwanted delay between looped synth plays WolfeCreek 1 3,014 Aug-02-2018, 09:24 PM
Last Post: Vysero
  Unwanted variable change in module dannyH 2 3,627 May-08-2018, 05:33 PM
Last Post: dannyH
  Unwanted random generation of scripted Shapes in GASP diemildefreude 3 6,602 Oct-23-2016, 03:11 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

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