LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Deleting text file lines

Hi all

I'm writing my first Excel/VBA macro, and having some trouble doing a
certain function. I know this is probably really basic stuff, but in
all my searches I haven't been able to find any documentation on
deleting text file lines. The data in the text file that I have to
import into excel is in the following format:

# aaaaaaa bbbbbb ccccc
# aaaaaaa bbbbbb ccccc
# aaaaaaa bbbbbb ccccc
# aaaaaaa bbbbbb ccccc
Aaaaaaa bbbbbb ccccc
Aaaaaaa bbbbbb ccccc
Aaaaaaa bbbbbb ccccc
Aaaaaaa bbbbbb ccccc
# aaaaaaa bbbbbb ccccc
# aaaaaaa bbbbbb ccccc
Aaaaaaa bbbbbb ccccc
Aaaaaaa bbbbbb ccccc

The lines that begin with '#' are comments, and don't need to be
imported into the worksheet. The rest of the lines do. How do I go
about writing a do-while loop that will delete the comment lines? I
know how to program in Java pretty well, so I know the logic behind
this process, I just don't know the vba language. Not that it makes
any difference, but the fields are tab delimited, so the file is
displayed nicely in excel once it is imported. All I have left is
deleting those comment lines, any help you guys can give me will be
hugely appreciated.

Thanks in advace,

Roman

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
A macro for deleting lines of text melara Excel Worksheet Functions 1 January 4th 10 07:29 AM
Copying certain lines from a text file Michael A Excel Discussion (Misc queries) 3 February 13th 07 08:08 PM
Deleting unused lines between used lines? Stevel Setting up and Configuration of Excel 1 November 25th 05 12:58 AM
excel97 vba to append lines to text file overwriting last 2 lines Paul Excel Programming 1 November 6th 04 08:11 PM
FileSystemObject to get last 10 lines of text file. john Excel Programming 11 July 16th 03 03:54 PM


All times are GMT +1. The time now is 11:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"