Python Forum
extract particular strings into a variable
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
extract particular strings into a variable
#1
Hi,

I have a requirement to get the string data like below.

str = "dsrc, combo, dsrc_hist, mapping, combo_hist"

If a particular value contains "hist" needs to assign to one variable and if not "hist" send him to another variable.

var1 = "dsrc_hist, combo_hist"
var2 = "dsrc, combo, mapping"

Can you please help me to achieve the above functionality?

Thx in advance
Reply
#2
Please show what you have tried so far, any errors, and specific location where you need help.
Reply
#3
Hello,
Hope you are well.

I can assist you with the requirement.
Can we have a detailed discussion regarding the same?
I can be reached at mail/skype:- [email protected]

Hoping to listen from you soon.
BR,
Sofia
Reply
#4
Thanks.. I resolved it my own

Thx,
Lokesh
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Trying to understand strings and lists of strings Konstantin23 2 757 Aug-06-2023, 11:42 AM
Last Post: deanhystad
  Splitting strings in list of strings jesse68 3 1,757 Mar-02-2022, 05:15 PM
Last Post: DeaD_EyE
  extract from strings some parts dervast 1 1,789 Jul-04-2019, 09:44 PM
Last Post: Axel_Erfurt
  Finding multiple strings between the two same strings Slither 1 2,511 Jun-05-2019, 09:02 PM
Last Post: Yoriz
  How to I define a variable between strings in telnetlib write? Fez 2 3,387 May-02-2019, 06:53 PM
Last Post: Fez
  Extract Strings From Text File - Out Put Results to Individual Files dj99 8 4,931 Jun-28-2018, 10:41 AM
Last Post: dj99
  lists, strings, and byte strings Skaperen 2 4,214 Mar-02-2018, 02:12 AM
Last Post: Skaperen
  Concatinating two strings to make a variable bencouve 5 4,967 Jun-21-2017, 10:06 PM
Last Post: Ofnuts

Forum Jump:

User Panel Messages

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