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
  Control of the number of daemon error messages to the file MarPan 3 86 Mar-25-2026, 11:00 AM
Last Post: DeaD_EyE
  Printing the code line number arbiel 6 2,548 Jun-30-2024, 08:01 AM
Last Post: arbiel
  Need to replace a string with a file (HTML file) tester_V 1 3,016 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 1,943 Aug-22-2023, 10:14 AM
Last Post: GYKR
Question Extracting Version Number from a String britesc 2 4,326 May-31-2023, 10:20 AM
Last Post: britesc
  File "<string>", line 19, in <module> error is related to what? Frankduc 9 17,737 Mar-09-2023, 07:22 AM
Last Post: LocklearSusan
  Getting last line of each line occurrence in a file tester_V 1 2,133 Jan-31-2023, 09:29 PM
Last Post: deanhystad
  Writing string to file results in one character per line RB76SFJPsJJDu3bMnwYM 4 5,734 Sep-27-2022, 01:38 PM
Last Post: buran
  Inserting line feeds and comments into a beautifulsoup string arbiel 1 3,027 Jul-20-2022, 09:05 AM
Last Post: arbiel
  TypeError: float() argument must be a string or a number, not 'list' Anldra12 2 7,897 Jul-01-2022, 01:23 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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