Solved

Word - Access

Posted on 2016-10-14
6
80 Views
Last Modified: 2016-10-26
I already Posted this question, but maybe i had some typo errors, so i revised it a little.

I have a .dat file when i open it with M/S Word, Notepad or WordPad the whole document is on one line because there is no line break only a Tilde "~" at the end of the line.
I would like to do a edit/replace with a carriage return.
 
Also is there a utility to convert the tilde to a carriage return?
I want to open it in ms Acc2010 thru code and process line by line.
Thanks in advance
0
Comment
Question by:frimy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 51

Accepted Solution

by:
Rgonzo1971 earned 250 total points
ID: 41844719
HI,

Yu could use word to replace the tilde

Home / Editing / Replace

Find What: ~
 
Replace With: ^p

Regards
0
 
LVL 16

Assisted Solution

by:theo kouwenhoven
theo kouwenhoven earned 250 total points
ID: 41844744
Use notepad++ and replace ~ with \r\n
0
 

Author Closing Comment

by:frimy
ID: 41845818
it works fine but I want to do programmatically
with vba
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 16

Expert Comment

by:theo kouwenhoven
ID: 41846529
With VBA would be something like:

Sub FindAndReplaceAll()
  Dim myRange As Range
  For Each myRange In ActiveDocument.StoryRanges
    With myRange.Find
      .Text = "~"
      .Replacement.Text = Chr(13) + Chr(10)
      .Wrap = wdFindContinue
      .Execute Replace:=wdReplaceAll
    End With
  Next myRange
End Sub


Chr(13)  + Chr(10) is CrLf, but you also can use the Chr(13) only.
0
 

Author Comment

by:frimy
ID: 41853007
Thanks
I was out of my office a few days.
I'm using Access code 2010. (it doesn't like the range type)
Can you give me an example?
Also, can I just pass to the function a FileName and replace or we have to create a new output file?
Thanks again
0
 

Author Comment

by:frimy
ID: 41860965
I already found a solution using the Replace function.
Thank you all
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I'm writing to share my clumsy experience in using this elegant tool so you can avoid every stupid mistake I made. (I leave it to the authorities to decide if this deserves a place in the Knowledge archives.)  Now that I am on the other side of my l…
Nice table. Huge mess. Maybe this was something you created way back before you figured out tabs or a document you received from someone else. Either way, using the spacebar to separate the columns resulted in a mess. Trying to convert text to t…
This video walks the viewer through the process of creating envelopes and labels, with multiple names and addresses. Navigate to the “Start Mail Merge” button in the Mailings tab: Follow the step-by-step process until asked to find the address doc…
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question