Solved

Parse

Posted on 2002-03-14
4
120 Views
Last Modified: 2010-05-02
The following code deletes everything from position 22 onwards. Could someone please modify it so that it deletes everything from character 16 BACKWARDS and leaves characters 17 to 21 aligned left on the page?

Thanks.

==================================================

Do Until EOF(File1)
   Line Input #File1, strLine 'Read Line by Line
   If Len(Trim(strLine)) > 21 Then
       Print #File2, Left(strLine, 21)
   Else
       Print #File2, strLine
   End If
Loop
0
Comment
Question by:muhammasif
  • 2
4 Comments
 
LVL 22

Expert Comment

by:rspahitz
ID: 6866132
print mid$(strLine, 17)

this will print everything starting from character 17 to the end of the string.
0
 
LVL 18

Accepted Solution

by:
deighton earned 25 total points
ID: 6866221
Do Until EOF(File1)
  Line Input #File1, strLine 'Read Line by Line
  If Len(Trim(strLine)) > 21 Then
      Print #File2, mid(strLine, 17,5)
  End If
Loop
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 6866296
Oops...yeah...I missed that "stop at char 21" part.  Make sure to add the ",5" as deighton shows.
0
 
LVL 6

Expert Comment

by:ebosscher
ID: 6867897
homework?
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question