Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6838167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:33:51+00:00 2026-05-26T23:33:51+00:00

I have multiple VB6 .frm files. See example below. I want to strip away

  • 0

I have multiple VB6 .frm files. See example below. I want to strip away the functions and subs from the code and leave only the form design.

What I need to do is find the last line starting with “Attribute” because after this line everything further should be deleted.

Using pattern matching or something similar, how can I process the .frm files so that everything after the last Attribute line is deleted? If I am traversing through a file, how can I tell where the last Attribute line is?

Example of .frm file:

VERSION 5.00
Begin VB.Form Form1
    Caption = "Form1"
    ClientHeight = 3195
    ClientLeft = 60
    ClientTop = 345
    ClientWidth = 4680
    LinkTopic = "Form1"
    ScaleHeight = 3195
    ScaleWidth = 4680
    StartUpPosition = 3 'Windows Default
    Begin VB.CommandButton Command1
        Caption = "Command1"
        Height = 495
        Left = 1800
        TabIndex = 1
        Top = 1320
        Width = 1215
    End
    Begin VB.TextBox Text1
        Height = 495
        Left = 360
        TabIndex = 0
        Text = "Text1"
        Top = 240
        Width = 1215
    End
End

Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Command1_Click()
    Text1.Text = "Hello World"
End Sub
Private Sub Form_Load()
    Text1.BackColor = vbBlue
End 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:33:52+00:00Added an answer on May 26, 2026 at 11:33 pm

    You just need 2 rules:

    1) If line starts with ‘Attribute’ then don’t delete.
    2) If line starts with ‘Attribute’ set a flag to start deleting all subsequent lines.

    Rule #1 will prevent you from deleting subsequent Attribute lines, and there should be nothing you want to keep after the first Attribute you encounter unless it’s an Attribute.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have multiple classes that all derive from a base class, now some of
I have multiple processes monitoring an MSMQ queue. I want to do multi-step operations
I have multiple threads processing events. I want to assign a nanosecond timestamp to
I have a RecordSet in VB6 containing multiple rows. I have to copy the
I have multiple css files in a directory (style0.css, style1.css etc..) How can I
In some VB6 code, I have a handler for a TreeView's Collapse event: Private
i want to parse VB6 code via Regex. However being new to Regex I
I have multiple publishers which want to persist their subscription info in storage. Is
I have multiple lines of text in log files in this kind of format:
I have multiple domains with multiple copies of jQuery.js in separate subfolders. I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.