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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:43:50+00:00 2026-06-17T15:43:50+00:00

In converting text from a word doc, the original author used a line of

  • 0

In converting text from a word doc, the original author used a line of periods
Friends and family......................................-1
XBox 360 ................................................-2

I want to get rid of long lines of consecutive periods. I want to keep sentences that use periods intact. So I do not want to remove all periods, just when they appear in groups of 3 or more.

  • 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-17T15:43:51+00:00Added an answer on June 17, 2026 at 3:43 pm

    Use a regular expression:

    import re
    
    consequitivedots = re.compile(r'\.{3,}')
    consequitivedots.sub('', inputstring)
    

    Demonstration:

    >>> import re
    >>> consequitivedots = re.compile(r'\.{3,}')
    >>> inputstring = '''\
    ... Friends and family......................................-1
    ... XBox 360 ................................................-2
    ... '''
    >>> consequitivedots.sub('', inputstring)
    'Friends and family-1\nXBox 360 -2\n'
    >>> print consequitivedots.sub('', inputstring)
    Friends and family-1
    XBox 360 -2
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to parse the text from a pdf file in perl without converting
What is the in built function for converting from text to FLOAT in Excel
I am reading binary data from db and converting it into text by using
Converting text from input file to morse code then placing results in an output
I've been tasked with converting some text log files from a test reporting tool
I am trying to extract graph information from a text file and converting it
I've tried converting the text to or from utf8, which didn't seem to help.
I am taking Spanned Text from an EditText box and converting it to a
I have a problem with converting a text file from ANSI to UTF8 in
Is it possible to copy text from a formatted MS Word document into a

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.