Python Forum
i want a simple fast string change command
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
i want a simple fast string change command
#1
i guess i'll need to write this. i would a simple fast string change command. yes, there is sed, and i use it a lot. it took years, but it now has the -i option to do edits in place. but it has long suffered from the regular expression problem that slows down using it. so my plan is to take 2 arguments as the replacement pair followed by any number of file names. every occurrence of the first string gets replaced by the 2nd string. if you guys were doing this, i'm sure you'd just want to invoked sed. if you can make code that cab reliably create regular expressions, then fine. i'll use str.replace().
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Forum Jump:

User Panel Messages

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