I am in need of a way to put a period at the end of every line in any document but the output will always be a text document.
So this is my plan...
1) Put a multiline textbox on form available for copy and paste of content from original file.
2) On button click... Use regex to find end of line ($) then add a period directly after it.
3) Loop through until end of file.
4) Once done a "save file dialog" should pop up asking where to save the text file.
So far I am only able to do step 1, I need a little help with steps 2-4. I have tried the following but it doesn't work...
What you are looking at is my misguided attempt at this. Please point me in the right direction.
-Thuan
So this is my plan...
1) Put a multiline textbox on form available for copy and paste of content from original file.
2) On button click... Use regex to find end of line ($) then add a period directly after it.
3) Loop through until end of file.
4) Once done a "save file dialog" should pop up asking where to save the text file.
So far I am only able to do step 1, I need a little help with steps 2-4. I have tried the following but it doesn't work...
VB.NET:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim oFile As System.IO.File
Dim oWrite As System.IO.StreamWriter
Dim Needy As String = tbx_main.Text
Dim Added As String = Regex.Replace(Needy, "(\p{P})(?=\Z|\r\n)", ".")
oWrite.Write(Added)
oWrite.Close()
oWrite = oFile.CreateText("C:\Text_to_Speech.txt")
End Sub
What you are looking at is my misguided attempt at this. Please point me in the right direction.
-Thuan