|
-
April 26th, 2001, 04:33 AM
#1
Delete line feeds in text files
Hello,
I've searched, and I've searched. Does anyone know an easy way to delete line feeds and/or carriage returns in a text file before Line Output to another text file (which I do before importing via code into Excel or Access?)
The program I am currently working looks like this. I've been trying to delete as much extraneous stuff from a print-to-file to
the other text file as possible, but I still
have blank lines.
Sub A10_PullFromControlOfHoursReport()
'
' A01_PullFromControlOfHoursReport Macro
' Macro recorded 4/25/01 by Kathy DuBach
'
Dim strInput As String
Open "C:\MyDocs\Payroll\Pay_DCPS\OrgCd_LineNos\Printfil.001" For Input As 1
Open "C:\MyDocs\Payroll\Pay_DCPS\OrgCd_LineNos\OrgCd_LineNos.txt" For Output As 2
Do Until EOF(1)
Line Input #1, strInput
If Mid(strInput, 4, 5) <> "START" And _
Mid(strInput, 9, 1) <> " " And _
Mid(strInput, 1, 1) <> "" And _
Mid(strInput, 9, 5) <> "TOTAL" Then
Print #2, strInput
End If
Loop
Close
End Sub
Kathy DuBach at [email protected]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|