Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Print only nth line
#1
FOR EXAMPLE THE FILE IS AS FOLLOWS:

[b]<td class="text-center">28,426</td>

<td class="text-center">240</td>

<td class="text-center">6,893,221</td>


Now say, I use the following code:

x=re.findall('<td\s+class\="text\-center">([0-9.,]+)</td>',x)

print(x)

which will print me all the above numerical values, but I only want to print the 2nd line what so ever the value in it maybe, how do I do it?

Thanks in advance
Reply


Messages In This Thread
Print only nth line - by AgileAVS - Feb-05-2020, 03:17 PM
RE: Print only nth line - by stullis - Feb-05-2020, 03:34 PM
RE: Print only nth line - by snippsat - Feb-05-2020, 03:47 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  problem with spliting line in print akbarza 3 433 Jan-23-2024, 04:11 PM
Last Post: deanhystad
  Print the line before the corrent line tester_V 9 1,630 Nov-18-2022, 08:39 AM
Last Post: Gribouillis
  Print to a New Line when Appending File DaveG 0 1,245 Mar-30-2022, 04:14 AM
Last Post: DaveG
  If match not found print last line tester_V 2 2,923 Apr-26-2021, 05:18 AM
Last Post: tester_V
  print a line break in writelines() method leodavinci1990 1 6,526 Oct-12-2020, 06:36 AM
Last Post: DeaD_EyE
  Print characters in a single line rather than one at a time hhydration 1 2,059 Oct-10-2020, 10:00 PM
Last Post: bowlofred
  How to print string multiple times on new line ace19887 7 5,848 Sep-30-2020, 02:53 PM
Last Post: buran
  Pattern Require Last Line Print() why? Harshil 4 2,465 Aug-08-2020, 04:54 PM
Last Post: Harshil
  print only last matched line tester_V 24 6,628 Apr-30-2020, 05:16 AM
Last Post: deanhystad
  item from a line to list however when i print the line instead of words i get letters Sutsro 5 3,030 Apr-22-2020, 02:39 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