Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
How do I ignore blank lines
Hi
I am reading data in from several text files and turning it into one text file, sometimes I get blank lines inserted into my output file. My method doesn't work. Any ideas please? Thanks Wendy Do While Not EOF(1) ' Loop until end of file. Line Input #1, textline ' Read line into variable. If textline = "" End If Else If Left(fname, 5) = "APSNL" Then Print #2, textline ' Print to the Scunny file Else Print #3, textline ' Print to the Hull file End If Loop Close #1 ' Close Input file. Kill pafname 'deletes Input file |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
How do I ignore blank lines
Untested, uncompiled:
Do While Not EOF(1) ' Loop until end of file. Line Input #1, textline ' Read line into variable. If textline = "" Then 'skip it Else If Left(fname, 5) = "APSNL" Then Print #2, textline ' Print to the Scunny file Else Print #3, textline ' Print to the Hull file End If Loop ===== Maybe... if trim(textline) = "" then 'skip it (Just in case there's a space character floating around. I'd also do this kind of check: If ucase(Left(fname, 5)) = "APSNL" Then to make sure upper/lower case didn't make a difference. Wendy wrote: Hi I am reading data in from several text files and turning it into one text file, sometimes I get blank lines inserted into my output file. My method doesn't work. Any ideas please? Thanks Wendy Do While Not EOF(1) ' Loop until end of file. Line Input #1, textline ' Read line into variable. If textline = "" End If Else If Left(fname, 5) = "APSNL" Then Print #2, textline ' Print to the Scunny file Else Print #3, textline ' Print to the Hull file End If Loop Close #1 ' Close Input file. Kill pafname 'deletes Input file -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Ignore blank cells | Excel Discussion (Misc queries) | |||
ignore blank | Excel Discussion (Misc queries) | |||
ignore blank cells | Excel Discussion (Misc queries) | |||
How to ignore blank cells | Charts and Charting in Excel | |||
how do you ignore blank cells | Excel Discussion (Misc queries) |