Python Forum
Using regex to count specific character in file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using regex to count specific character in file
#1
Using regex to count specific character in file

i have a hard time getting the right output using regex to count "$" on the file

#content in sample1.txt
i have $100 in my bank acc now
i made $20 lastnight

#desired output in sample2.txt
$ found in file: 2
Reply
#2
show what you have tried.
ndc85430 likes this post
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [split] how to read a specific row in CSV file ? laxmipython 2 8,882 May-22-2020, 12:19 PM
Last Post: Larz60+
  Read text file, process data and print specific output Happythankyoumoreplease 3 2,921 Feb-20-2020, 12:19 PM
Last Post: jefsummers
  To extract a specific column from csv file and compute the average vicson 2 8,111 Oct-20-2018, 03:18 AM
Last Post: vicson
  Unexpected character after line continuation character joshyb123 5 10,650 Sep-05-2018, 08:08 AM
Last Post: perfringo
  unexpected character after line continuation character error newbie 10 14,661 Aug-09-2018, 06:07 PM
Last Post: nilamo
  Count Letters in a Sentence (without using the Count Function) bhill 3 5,198 Jun-19-2018, 02:52 AM
Last Post: bhill

Forum Jump:

User Panel Messages

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