> I'm quit new at this, so I could really need some help, to make some
> VBA code for my problem.
[quoted text clipped - 7 lines]
> first part by hand.
> Thanks in advanced.
Here's some sample code:
'----- start of code -----
Sub MakeFile80()
Dim lngBytesLeft As Long
Dim iFileIn As Integer
Dim iFileOut As Integer
Dim strLine As String
iFileIn = FreeFile
Open "C:\Temp\OneLongLine.txt" For Input As iFileIn
iFileOut = FreeFile
Open "C:\Temp\Fixed80Lines.txt" For Output As iFileOut
lngBytesLeft = LOF(iFileIn)
Do While lngBytesLeft > 0
If lngBytesLeft < 80 Then
strLine = Input(lngBytesLeft, iFileIn)
' Drop trailing CR/LF if present.
If Right(strLine, 2) = vbCrLf Then
strLine = Left(strLine, Len(strLine) - 2)
End If
' Pad short line to 80 bytes.
strLine = Left(strLine & Space(80), 80)
lngBytesLeft = 0
Else
strLine = Input(80, iFileIn)
lngBytesLeft = lngBytesLeft - 80
End If
Print #iFileOut, strLine
Loop
Close iFileIn, iFileOut
End Sub
'----- end of code -----

Signature
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)
Leika - 18 Mar 2005 11:43 GMT
Thanks.
It was a super answer, and it worked perfect.
Now I can get on with my project.
"Dirk Goldgar" skrev:
> > I'm quit new at this, so I could really need some help, to make some
> > VBA code for my problem.
[quoted text clipped - 50 lines]
> End Sub
> '----- end of code -----