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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:52:09+00:00 2026-06-11T16:52:09+00:00

I need to delete all lines from a file containing a match for read

  • 0

I need to delete all lines from a file containing a match for read (symbol), where (symbol) is any CJK character. In matches were read (symbol) is immediately preceded by A-Z or a-z, however, then the line should not be deleted. E.g., here are some sample lines and results:

Do you like to read books? (not deleted)
Can you read 书? ( deleted)
.read 书. (deleted)
This is some thread 线. (not deleted)

How can I delete only those lines matching (not A-Z or a-z)read (CJK symbol)?

  • 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-11T16:52:10+00:00Added an answer on June 11, 2026 at 4:52 pm

    I’m not entirely sure how to match CJK characters, but if you match non-ASCII characters you may achieve the results you’re looking for:

    grep -vP "[^A-Za-z]read [\x80-\xFF]" file.txt
    

    Theoretically, you should be able to do:

    grep -vP "[^A-Za-z]read [\x{2E80}-\x{9FBB}]+" file.txt
    

    However in my testing, I get error:

    grep: character value in \x{...} sequence is too large
    

    http://en.wikipedia.org/wiki/List_of_Unicode_characters#CJK_unified_ideographs

    EDIT:

    LC_ALL="POSIX" sed -r '/[^A-Za-z]read [\o200-\o377]+/d' file.txt
    

    Results:

    Do you like to read books? (not deleted)
    This is some thread 线. (not deleted)
    

    Also see:

    How to delete all CJK text appearing immediately after a particular symbol?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey, I need to delete all images from a string and I just can't
How to delete all lines below a word except last line in a file.
I have a big html file (87000+ lines) and want to delete all occurrences
I need to delete all the folders in current directory that starts with say
Using Python I need to delete all characters in a multiline string up to
Need a batch script to delete all records in a SQL Server CE database
I need a function to delete all the csv files in a folder A,
I need to create Trigger for delete action which backsup all fields old value
I need to delete rows in a table, such as DELETE FROM TABLE_X WHERE
I need to delete a picture from a folder where pictures are stored. For

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.