Link to home
Avatar of THURMAN SMITH
THURMAN SMITHFlag for United States of America

asked on

MS WORD TEXT IMPORT NOT WORDWRAPPING

I have plain ASCI text files created in an edit program, (VEDIT) which adds a CRLF (hex 13 09) at the end of each line when writing.  (I add an extra carriage return to start a new paragraph.)
I want to import these  files into MS WORD 2007, which unfortunately does not ignore the single CRLF pairs, so the line breaks are not always appropriate for the MS WORD session (some lines are too short).  How do I get WORD to word wrap the file at import time?  Or if that if not a feature, is there any way to efficiently wrap the text after importing.
Avatar of CompProbSolv
CompProbSolv
Flag of United States of America image

One way to do it involved search and replace.  The idea is to search for CRLF and replace it with nothing.  The problem is that it will also delete the paragraph breaks that you have created.  Assuming you have  CRLF CRLF where you want the paragraph breaks, the following should work:

Note: to search for CR, use ^p  ; for LF use ^l

Search for ^p^l^p^l and replace with xyzxyz (or any other string that doesn't appear in your document.  This will preserve your paragraph breaks.

Search for ^p^l and replace with a space.  I'm assuming that there is not already a space.  This will get rid of the unwanted line breaks.

Search for xyzxyz (or whatever else you used earlier) and replace with ^p^l.  That should put the paragraph breaks back in.
Avatar of THURMAN SMITH

ASKER

^p^l^p^l   search/replace  found nothing!
OBCARE.txt
Actually I learned from a MS forum that ^p covers a CRLF pair. That why ^p^l wasn't finding anything.
Avatar of Rgonzo1971
Rgonzo1971

Hi,

You could find and replace
1.
Find what: ^p
Replace With: ^l
2.
Find what: ^l^l
Replace With: ^p^p
1.
Find what: ^l
Replace With:
(Nothing in replace With)

Regards
which adds a CRLF (hex 13 09) at the end of each line
CrLf is x0D0A and not x1309

Please verify these EOL characters for us.

Please post a sample text file.
I did the following find/replace operations:
Replace all ^p^p with ####
Replace all ^p with ""  (empty string)
Replace all #### with ^p^p

the attached Word document is the result
OBCARE.docx
Thanks, but this solution removed the space between many of the words within a line.
Yes xODOA are the CRLF values in the document.
ASKER CERTIFIED SOLUTION
Avatar of aikimark
aikimark
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Rgonzo1971   solution resulted in many a space dropped between two words/.


aikimark  Revised much better, but it did add a space between two words in several  cases on each page.
HI,

then try

Hi,

 You could find and replace
 1.
 Find what: ^p
 Replace With: ^l
 2.
 Find what: ^l^l
 Replace With: ^p^p
 3.
 Find what: ^l
 Replace With:
 (Space)
4.
 Find what:
 (Space)(Space)
 Replace With:
 (Space)

 Regards
@smithtoff

Where were the extra spaces?
No responses quite worked.
@smithtoff

Please answer my question.  Where were the extra spaces?