Code.GeekInterview.com
  I am new, Sign me up!
 
Code Samples VB.NET
 

Remove Blank Lines from Script Files


Code ResourceAuthor: Lokesh M  

Difficulty Level:

Published: 26th Aug 2007   Read: 1557 times  

Filed in: VB.NET
Add Comment


 


Sometimes while using FTP one may find the script files transferred to have additional blank lines, which could make the script clumsy and messy to read or modify.  Here is a simple code to remove Blank Lines in Script Files.

Note :

  1. Please take a backup of original script or text file.
  2. This code makes no distinction between intentional blank line and the lines that have been appended when transferring via FTP.
 


Sample Code
  1.  
  2. Public Function RemoveLines()
  3.     Open "C:my_script.php" For Input As #1
  4.     Open "C:my_script_new.php" For Output As #2
  5.    
  6.     While Not EOF(1)
  7.         Line Input #1, TextLine
  8.         TextLine2 = Trim(TextLine)
  9.         If Len(TextLine2) > 0 Then
  10.             Print #2, TextLine
  11.         End If
  12.     Wend
  13.    
  14.     Close #1
  15.     Close #2
  16. End Function
  17.  
Copyright GeekInterview.com


Next Article: Split Name to First and last Name


 

Latest Code Samples

 

Popular Code Samples

 

Related Code Samples

 

Post Comment


Members Please Login

Name:  Email: (Optional. Used for Notification)

Title:
 
Comment:
Validation Code: <=>  (Enter this code in text box)





Popular Coders

# Coder NameHits
1. Lokesh5942
2. supersubra2506
3. Lokesh M1558
4. Biswabed Dash828

Active Coders

# Coder NameCodes
1. supersubra1
2. Biswabed Dash1
3. Lokesh1
4. Lokesh M1

Refined Tags

 

Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact  

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape