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

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.
Help is to give assistance or support.

Write a code and there will be assistance or support. With no code nothing to give assistance or support to.
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.

Possibly Related Threads…
Thread Author Replies Views Last Post
  Print to a New Line when Appending File DaveG 0 198 Mar-30-2022, 04:14 AM
Last Post: DaveG
  Find and delete above a certain line in text file cubangt 12 810 Mar-18-2022, 07:49 PM
Last Post: snippsat
  CSV to Text File and write a line in newline atomxkai 4 717 Feb-15-2022, 08:06 PM
Last Post: atomxkai
  File "<string>", line 19, in <module> error is related to what? Frankduc 8 1,609 Jan-27-2022, 05:59 PM
Last Post: Frankduc
Question Help to find the largest int number in a file directory SalzmannNicholas 1 458 Jan-13-2022, 05:22 PM
Last Post: ndc85430
  writelines only writes one line to file gr3yali3n 2 655 Dec-05-2021, 10:02 PM
Last Post: gr3yali3n
  append a string to a modified line Mr_Blue 10 1,706 Sep-16-2021, 07:24 PM
Last Post: Mr_Blue
  How to capture string from a line to certain line jerald 1 1,003 Jun-30-2021, 05:13 PM
Last Post: Larz60+
  [Solved] Reading every nth line into a column from txt file Laplace12 7 2,360 Jun-29-2021, 09:17 AM
Last Post: Laplace12
  TypeError: int() argument must be a string, a bytes-like object or a number, not 'Non Anldra12 2 2,383 May-02-2021, 03:45 PM
Last Post: Anldra12

Forum Jump:

User Panel Messages

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