Solved

Parse

Posted on 2002-03-14
4
114 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now