Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 152215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:35:00+00:00 2026-05-11T09:35:00+00:00

I m looking for a way to find and replace large number of text

  • 0

I m looking for a way to find and replace large number of text files. For example;

I want to choose;

<li><a href=''>Istanbul, TR POS </a></li> <li><a href=''>Ankara, TR POS </a></li> <li><a href=''>Izmir, TR POS </a></li> 

WITH;

<li><a href='pos-istanbul-tr.php'>Istanbul, TR POS </a></li> <li><a href='pos-ankara-tr.php'>Ankara, TR POS </a></li> <li><a href='pos-izmir-tr.php'>Izmir, TR POS </a></li>  

Notice that initial of the label is lowercased and also added as part of the link. This should be done for a large number of text files so i m looking for the most efficient way via regex or any software that you think that might help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T09:35:01+00:00Added an answer on May 11, 2026 at 9:35 am
    $ perl -i.bak \ >  -pe's/href=''>([^,]+)/\'href='pos-\'. (lc $1) . \'-tr.php'>\'. $1/eg' \ >  *.html 

    Cross-platform variant (+ building on @Jonathan Leffler’s answer)

    Save it to fill-href.pl:

    #!/usr/bin/perl -w -pi.bak s/href=''>([^,]+)/href='pos-\L$1\E-tr.php'>$1/g 

    Run:

    perl fill-href.pl test1.html test2.html 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 69k
  • Answers 69k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Here's a simple example: enum RoundingMode { UP { public… May 11, 2026 at 12:40 pm
  • added an answer A lttle trickery can emulate what you desire. Only the… May 11, 2026 at 12:40 pm
  • added an answer Thats a known bug. You can see the bug report… May 11, 2026 at 12:40 pm

Related Questions

I'm looking for a way to find the name of the Windows default printer
I'm looking for a way to find references to a web method in other
I'm looking for a way to find out the URL of a SWF using
I'm looking for a way to find the status of a live stream through
I'm looking for a way to poll different servers and check that SQL server
Is there a idiomatic way of removing elements from PATH-like shell variables? That is
Anyone knows how can I change the text of a Word.Range object but still
I was looking for a generic method in .Net to encode a string for
I've been looking through the ANTLR v3 documentation (and my trusty copy of The
My web application parses data from an uploaded file and inserts it into a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.