i need to get information from different records in one record.
There are some restrictions:
the first character of the record must be the same
the second until the 21st character must be the same
the information i have to put together starts from position 33
the startposition of this information may never be the same.
i.e.:
0800100
0800100
In the attachement you will find the begin situation and the desired situation.
This is the code i'v made this far:
Sub Main()
Dim i As Integer
sOldfile1 = "c:\floreac\flores2.txt"
sFile2 = "c:\floreac\flores2.dat"
Open sOldfile1 For Input As #1
Open sFile2 For Output As #2
Line Input #1, sstring
sTOREString = sstring
Do While Not EOF(1) ' Check for end of file.
If (Left(sTOREString, 15) = Left(sstring, 15)) Then
If (Mid(sTOREString, 16, 6) = Mid(sstring, 16, 6)) Then
If (Left(sTOREString, 1) = Left(sstring, 1)) Then
If (lengte1 <> lengte2) Then
can anybody help me plz? This is very urgent.
ideas or functions i better use are also welcome.
I think the problem i've got is to print the storestring at the right time.
One thing though, with the space in the text file, does that symobolize the end of a piece of text?
the first character of the record must be the same
the second until the 21st character must be the same
the information i have to put together starts from position 33
the startposition of this information may never be the same.
does this mean that anything after a space, cannot appear twice in the final string?
txtOutput = ""
Dim strList As Variant
strList = Split(txtInput, " ")
For Each varlist In strList
If InStr(1, txtOutput, varlist) = 0 Then
txtOutput = txtOutput & varlist & vbCrLf
End If
Next