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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:08:56+00:00 2026-06-01T00:08:56+00:00

So what I have is a MS Word docx file that contains some data

  • 0

So what I have is a MS Word docx file that contains some data which is not really sorted really nice.

/example output

1.
Lastname, Firstname

Address, City, State Zip

By doing Ctrl+Shift+* I can view all the special characters that exists within the file.

( ¶, ˚ , etc…)

then replace them with a “,” to act as a separator then export the file on an excel format.

Would there be a way to replace this symbols using PHP?

  • 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-01T00:08:57+00:00Added an answer on June 1, 2026 at 12:08 am

    This issue has been flogged many times here .. am only responding because yours have a little twist.

    What you need to do is remove all the characters you don’t want , then replace all spaces ” ” with “,”

    Removing none ASII Characters (3 Examples)

    $string = preg_replace('/[^(\x20-\x7F)]*/','', $string);
    $string = preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $string);
    $string = preg_replace( '/[^[:print:]]/', '',$string);
    

    Removing UTF8 Characters

    $string = preg_replace('/[\x00-\x08\x0B\x0C\x0E-\x1F\x80-\xFF]/u', '', $string);
    

    Removing Line Feeds , Carriage Returns and Tabs

    $string = preg_replace('/[\x00-\x1F\x80-\xFF]/u', '', $string);
    

    Replacing ” ” with “,” ;

    $string = str_replace(" ",",",$string);
    $string = trim($string,",");
    

    You have more than enough options now ..

    I hope this helps

    Thanks
    🙂

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

Sidebar

Related Questions

I have a word document (docx format) that I need to populate with data
Word 2007 saves its documents in .docx format which is really a zip file
I have to split the word in a sentence which contains more than 40
I have a bit of code that will open a Word 2007 (docx) document
I have an word file that contain my specified pattern text {pattern} and I
I have seen in a few cases that converting a file from Microsoft Word
I have a few thousand word files which some of my colleagues have put
I have a ASP.net 4.0 which has to generate a PDF and docx file
I have a word document that was saved as xml. now I need to
I have Microsoft Word template that I automated filling it's fields from my application,

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.