Python Forum
Extract text based on postion and pattern
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extract text based on postion and pattern
#1
Hello Gurus,

I am from sql background and i am working on one python requirement to extract text from the give string based on position and pattern.

For e.g

input search_pattern position expected_output
'inf***maint***three' *** 2 maint
'but@@milk@@ghee @@ 3 ghee
'but@@milk@@ghee @@ -3 but

Have tried above using substring and instr in sql but very leangth code.

Can any one guide me
Reply


Messages In This Thread
Extract text based on postion and pattern - by guddu_12 - Sep-27-2021, 11:05 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Color a table cell based on specific text Creepy 11 2,113 Jul-27-2023, 02:48 PM
Last Post: deanhystad
  extract only text strip byte array Pir8Radio 7 3,046 Nov-29-2022, 10:24 PM
Last Post: Pir8Radio
  Extract only certain text which are needed Calli 26 6,229 Oct-10-2022, 03:58 PM
Last Post: deanhystad
  Extract text rektcol 6 1,716 Jun-28-2022, 08:57 AM
Last Post: Gribouillis
  select Eof extension files based on text list of filenames with if condition RolanRoll 1 1,555 Apr-04-2022, 09:29 PM
Last Post: Larz60+
  Extracting Specific Lines from text file based on content. jokerfmj 8 3,111 Mar-28-2022, 03:38 PM
Last Post: snippsat
  Extract a string between 2 words from a text file OscarBoots 2 1,899 Nov-02-2021, 08:50 AM
Last Post: ibreeden
Thumbs Up [SOLVED] Find last occurence of pattern in text file? Winfried 4 4,474 Aug-13-2021, 08:21 PM
Last Post: Winfried
  regex pattern to extract relevant sentences Bubly 2 1,901 Jul-06-2021, 04:17 PM
Last Post: Bubly
  Extract specific sentences from text file Bubly 3 3,458 May-31-2021, 06:55 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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