Solved

Parse

Posted on 2002-03-14
4
126 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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.
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…
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…

691 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