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 7799711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T00:24:04+00:00 2026-06-02T00:24:04+00:00

I have a file containing many vowels with diacritics. I need to make these

  • 0

I have a file containing many vowels with diacritics. I need to make these replacements:

  • Replace ā, á, ǎ, and à with a.
  • Replace ē, é, ě, and è with e.
  • Replace ī, í, ǐ, and ì with i.
  • Replace ō, ó, ǒ, and ò with o.
  • Replace ū, ú, ǔ, and ù with u.
  • Replace ǖ, ǘ, ǚ, and ǜ with ü.
  • Replace Ā, Á, Ǎ, and À with A.
  • Replace Ē, É, Ě, and È with E.
  • Replace Ī, Í, Ǐ, and Ì with I.
  • Replace Ō, Ó, Ǒ, and Ò with O.
  • Replace Ū, Ú, Ǔ, and Ù with U.
  • Replace Ǖ, Ǘ, Ǚ, and Ǜ with Ü.

I know I can replace them one at a time with this:

sed -i 's/ā/a/g' ./file.txt

Is there a more efficient way to replace all of these?

  • 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. Editorial Team
    Editorial Team
    2026-06-02T00:24:05+00:00Added an answer on June 2, 2026 at 12:24 am

    If you check the man page of the tool iconv:

    //TRANSLIT
    When the string "//TRANSLIT" is appended to –to-code, transliteration is activated. This means that when a character cannot be represented in the
    target character set, it can be approximated through one or several similarly looking characters.

    so we could do :

    kent$  cat test1
        Replace ā, á, ǎ, and à with a.
        Replace ē, é, ě, and è with e.
        Replace ī, í, ǐ, and ì with i.
        Replace ō, ó, ǒ, and ò with o.
        Replace ū, ú, ǔ, and ù with u.
        Replace ǖ, ǘ, ǚ, and ǜ with ü.
        Replace Ā, Á, Ǎ, and À with A.
        Replace Ē, É, Ě, and È with E.
        Replace Ī, Í, Ǐ, and Ì with I.
        Replace Ō, Ó, Ǒ, and Ò with O.
        Replace Ū, Ú, Ǔ, and Ù with U.
        Replace Ǖ, Ǘ, Ǚ, and Ǜ with U.
    
    
    kent$  iconv -f utf8 -t ascii//TRANSLIT test1
        Replace a, a, a, and a with a.
        Replace e, e, e, and e with e.
        Replace i, i, i, and i with i.
        Replace o, o, o, and o with o.
        Replace u, u, u, and u with u.
        Replace u, u, u, and u with u.
        Replace A, A, A, and A with A.
        Replace E, E, E, and E with E.
        Replace I, I, I, and I with I.
        Replace O, O, O, and O with O.
        Replace U, U, U, and U with U.
        Replace U, U, U, and U with U.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I have a big file containing many zeros, how can i efficiently make
I have a file containing records delimited by the pattern /#matchee/. These records are
I have a module (tools.py) containing many classes. I'd like to extract these out
I have a folder structure with one main parent folder containing many subfolders, and
I have a string containing many words with at least one space between each
I have a file containing many words ending in a . , most of
I have a txt file containing many records, each record has 5 rows and
I have created a pdf file containing a table in many pages and I'm
I have a file containing many prime numbers. I'd like to write a module
I have a file containing many columns of text, including a timestamp along the

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.