Python Forum
line number of first and second occurance of string in a file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
line number of first and second occurance of string in a file
#1
Hello,

Here is the logic I am trying to code.

* I have a line number of a certain string in a file. I want to get the line number of second occurrence of that string in a file.

Please help me to write the code.
Reply


Messages In This Thread
line number of first and second occurance of string in a file - by mdalireza - Nov-18-2019, 12:38 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Need to replace a string with a file (HTML file) tester_V 1 699 Aug-30-2023, 03:42 AM
Last Post: Larz60+
  Sequential number for rows retrieved and storing the Primary UKey to the line number GYKR 2 555 Aug-22-2023, 10:14 AM
Last Post: GYKR
Question Extracting Version Number from a String britesc 2 1,030 May-31-2023, 10:20 AM
Last Post: britesc
  File "<string>", line 19, in <module> error is related to what? Frankduc 9 12,391 Mar-09-2023, 07:22 AM
Last Post: LocklearSusan
  Getting last line of each line occurrence in a file tester_V 1 811 Jan-31-2023, 09:29 PM
Last Post: deanhystad
  Writing string to file results in one character per line RB76SFJPsJJDu3bMnwYM 4 1,305 Sep-27-2022, 01:38 PM
Last Post: buran
  Inserting line feeds and comments into a beautifulsoup string arbiel 1 1,144 Jul-20-2022, 09:05 AM
Last Post: arbiel
  TypeError: float() argument must be a string or a number, not 'list' Anldra12 2 4,758 Jul-01-2022, 01:23 PM
Last Post: deanhystad
  Print to a New Line when Appending File DaveG 0 1,189 Mar-30-2022, 04:14 AM
Last Post: DaveG
  Find and delete above a certain line in text file cubangt 12 3,353 Mar-18-2022, 07:49 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