?
Solved

Parse

Posted on 2002-03-14
4
Medium Priority
?
137 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 100 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

809 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