I have a number of .TXT files that are output data. Each file is formatted as 1 long string of characters. I have sourced out some code to add CR's every 100 characters. I will need to modify the code for each file because the spec file for each is different (some are 513 characters long, others are 96 characters long).
The code I have found is below. The problem is, I do not know how to utilize it in this situation. Can someone provide a step-by-step to use this code using Access?
Dim sr As New StreamReader(...)
Dim sb As New StringBuilder(sr.ReadToEnd())
Dim currentIndex As Int32 = 100
While currentIndex < sb.Length
sb.Insert(currentIndex, vbCrLf)
currentIndex += 102 '100 characters + vbCrLf.Length (2)
End While
The code I have found is below. The problem is, I do not know how to utilize it in this situation. Can someone provide a step-by-step to use this code using Access?
Dim sr As New StreamReader(...)
Dim sb As New StringBuilder(sr.ReadToEnd())
Dim currentIndex As Int32 = 100
While currentIndex < sb.Length
sb.Insert(currentIndex, vbCrLf)
currentIndex += 102 '100 characters + vbCrLf.Length (2)
End While