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

  • Home
  • SEARCH
  • 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 8903261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:49:30+00:00 2026-06-15T01:49:30+00:00

I have a datafile containing a large number of sentences, encoded like this: Gib

  • 0

I have a datafile containing a large number of sentences, encoded like this:

“Gib mir bitte Erk\u00e4ltung”

I also have a datafile containing a large number of keywords, encoded like this:

“Erkältung”

I would like to search for keywords in sentences and then write them out to a file, in the “Erkältung” format.

How would I convert \u00e4 to ä without having to do:

String.replace(‘\u00e4’, ‘ä’)

More exactly, I would like to have this return a match in Python 2.6:

(#coding: utf-8)

sentence = "Gib mir bitte Erk\u00e4ltung"

keyword = "Erkältung"

re.search(keyword, line)

Any hints?

  • 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-15T01:49:32+00:00Added an answer on June 15, 2026 at 1:49 am

    Python has some handy character encoding conversions built in. In this case unicode_escape is what you want. When you read in your sentence, convert it as follows prior to doing your search:

    # Original sentence:
    
    >>> s = "Gib mir bitte Erk\u00e4ltung"
    
    >>> print s
    Gib mir bitte Erk\u00e4ltung
    
    >>> print repr(s)
    'Gib mir bitte Erk\\u00e4ltung'
    
    
    # Converted sentence:
    
    >>> sc = s.decode('unicode_escape')
    
    >>> print sc
    Gib mir bitte Erkältung
    
    >>> print repr(sc)
    u'Gib mir bitte Erk\xe4ltung'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a datafile (tab separated) which looks like this: chr1 38045559 38046059 chr1:38045559-38046559_NM_001142726_C1orf122_+,chr1:38045559-38046559_NM_198446_C1orf122_+,chr1:38045952-38046952_NM_024640_YRDC_-
I have a datafile that looks like this #index name1 name2 name3 1 2
I have a data file containing a combination of doubles and strings like this:
My problem is this: I have a number of very large data files (totaling
I have a datafile that looks like this: 1 1.0 0 2 1.5 0
I have a data file that looks like this: xyz123 2.000 -0.3974 0.0 hij123
I have a DataGrid that looks like this (slightly simplified here): <asp:DataGrid ID=grdQuotas runat=server
If i have a large data file containing integers of an arbitrary length needing
I have a data file containing timestamps like 1331856000000. Unfortunately, I don't have a
I have this datafile [abc] def ghi [jkl] [mno] From this file; i can

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.