Hi, I have the following code that reads an XML file and pulls out attributes for a specific node to a listview control, which works as expected. I am now trying to also pull out specific node data <Words> and <Segments> from under the <Total> element and add to the listview. I was wondering...
Thanks again with the help with the code, it does make the replacement in all blocks of text but unfortunately, it does not write back all lines of text. The line of text it omits, is “Report-Output”.
Here is the code I have
Dim sr As IO.StreamReader = New...
Sorry, forgot to add star, it has been a while since using the forum.
May I also ask about the code sample supplied, it works great if the file contains one block of text as per my initial query, but if there are more than 1 blocks of text, it will only do the replace in the first block of text...
Hi, I did attempt to use the split method (samples found on web) by reading each line but to be honest as my coding experience is limited, I came up blank on what to do next.
Dim sr As IO.StreamReader = ("c:\report.txt")
Dim contents As New List(Of String)
Do While sr.Peek <> -1...
I have also tried playing around with regex but no joy
Dim fileText As String = System.IO.File.ReadAllText("C:\report.txt")
Dim pattern As String = Regex.Escape("Report-Output" & "(?s)(.+?)" & "Report End")
modifiedText = System.Text.RegularExpressions.Regex.Replace( _...
Hi, I have this code that works fine for replacing in TXT file. I need to change the code so only to perform the replace in groups of text.
Dim Fs As FileStream = New FileStream("C:\report.txt", FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite)
Dim sw As New...
I did not wait for a reply, i checked the post in regular intervals.
How long should a person wait: 24 hours, 48, hours, 96, hours or until they are so old they have forgotten that they actually submitted a post.
From my experience with forums if there has not been any updates to a post in 24...
Hi
I posted to this forum as i did not receive any reply from the other forum in 24 hours, so assumed it would not get answered.
I apologize if you feel i wasted your time.
Thanks
Hi
I have table in a word file that contains 2 columns. What i am trying to do is search through the second column for blank cells and if found copy the text from the adjoining cell that is in the first column to the blank cell.
I found some code for searching blank cells but i need help on...
Hi
I have a VB.NET application that opens an MS Word file and runs a macro, which works fine.
Is it possible to edit an MS Word macro from a VB.net application.
Thanks
Here is the code that i have at the momment
Dim all_lines As Array
Dim lines As New List(Of String)
all_lines = File.ReadAllLines("c:\test.txt")
lines.AddRange(all_lines)
Array.Clear(all_lines, 0, Text.Length)...
Hi
What is the best approach to search a txt file for a specific piece of text and when found delete that line and the next 5 lines from the TXT file
I have code to delete the line that contained the searched text but lost on how to delete the next 5 lines.
Thanks
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.