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
#2
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  append a string to a modified line Mr_Blue 10 839 Sep-16-2021, 07:24 PM
Last Post: Mr_Blue
  How to capture string from a line to certain line jerald 1 573 Jun-30-2021, 05:13 PM
Last Post: Larz60+
  [Solved] Reading every nth line into a column from txt file Laplace12 7 1,205 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 1,734 May-02-2021, 03:45 PM
Last Post: Anldra12
Exclamation Why there's a 'blank line' on CSV file? brunolelli 4 1,098 Mar-25-2021, 03:43 AM
Last Post: buran
  cursor.execute: How to insert dynamic number in a string? stoeberhai 2 1,106 Mar-18-2021, 12:55 PM
Last Post: stoeberhai
  Regular expression: cannot find 1st number in a string Pavel_47 2 923 Jan-15-2021, 04:39 PM
Last Post: bowlofred
  How to create new line '/n' at each delimiter in a string? MikeAW2010 3 948 Dec-15-2020, 05:21 PM
Last Post: snippsat
  How to print string multiple times on new line ace19887 7 2,295 Sep-30-2020, 02:53 PM
Last Post: buran
  Please support regex for version number (digits and dots) from a string Tecuma 4 1,161 Aug-17-2020, 09:59 AM
Last Post: Tecuma

Forum Jump:

User Panel Messages

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