Solved

Loading Data

Posted on 1998-08-31
14
177 Views
Last Modified: 2010-04-30
Dear Experts,
   I am in deperate need of some help on the following question.
 
How would I load all data from a file extension (it's my own, .ssf) that is between some keynames.  Example...
Inside the file, it has
[Numbers]
1
2
3
[end=Numbers]
how would i load up the 1 2 and 3 and have it look just like it is displayed inside of the file, except without having the [Numbers] and [end=Numbers] when it loads up.  Looking back over my question, it seems a little confusing, so if you need some further info, just let me know.  
Thanx,
-jrProgrammer-
0
Comment
Question by:jrProgrammer
[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
  • 10
  • 4
14 Comments
 
LVL 3

Accepted Solution

by:
a111a111a111 earned 80 total points
ID: 1432169
If you mean you want to load it looks like load into a second file or a textbox :
So from here I can make a little code for you that will filter out some Lines
contain [Numbers]  and    [end=Numbers]

So please give me some time to post a code for you.

0
 
LVL 3

Expert Comment

by:a111a111a111
ID: 1432170
What Version of Visual Basic are ou using.
I can make a program for you in VB 3.0 or VB 5.0.

0
 

Author Comment

by:jrProgrammer
ID: 1432171
I'm using vb5.  Now the code that you can make, will that load only the 1 2 and 3 and place it in a multi-lined textbox.
[Numbers]
1
2
3
[end=Numbers]
and in the multi-lined textbox it will put
1
2
3
exactly like that?

0
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
LVL 3

Expert Comment

by:a111a111a111
ID: 1432172
Yes thats it...
Coming soon.
0
 
LVL 3

Expert Comment

by:a111a111a111
ID: 1432173
Here is the code:

Option Explicit  '*** use it all the time

Private Sub cmdRead_Click()
  Dim LineOfText$
  Dim AllText$
  Dim Wrap$
 
  Wrap$ = Chr$(13) + Chr$(10)  'create wrap character
  'On Error Resume Next
 
  Open "c:\numbers.ssf" For Input As #1 ' make sure the Path is correct.
                                                               ' or make path like "c:\filename.ssf"
 
  Do Until EOF(1)
    Line Input #1, LineOfText
   
    If IsNumeric(LineOfText$) Then
        AllText = AllText & LineOfText & Wrap
    End If
   
Loop
Close #1

Text1.Text = AllText
MsgBox "Done Reading"
End Sub

if you want the complete project dowload it  from

http://www.hili.com/~shay/numbers.zip
0
 
LVL 3

Expert Comment

by:a111a111a111
ID: 1432174
jrProgrammer.

You can download the complete project form
http://www.hili.com/~shay/numbers.zip
0
 
LVL 3

Expert Comment

by:a111a111a111
ID: 1432175
BTW.
I show here one way to perform what you asked.
If you want more help or anything codeing and so please email to shay@hili.com


0
 

Author Comment

by:jrProgrammer
ID: 1432176
Alright, i like the code, and it works for numbers, but how would i get it to work for a specified keyname?
example: I want to only load up whats inside the [a] and [end=a]
[a]

[end=a]
1this
2is
3a
test
[b]
another
test
[end=b]
ect.
so how would i get it to only load up the
1this
2is
3a
test
?

Thanks for your time.
0
 
LVL 3

Expert Comment

by:a111a111a111
ID: 1432177
Okay I am working on this one as well.

in a few you get the code.
0
 

Author Comment

by:jrProgrammer
ID: 1432178
okay!  you don't know how much this is helping!  I'm gonna raise the point value for ya.
0
 
LVL 3

Expert Comment

by:a111a111a111
ID: 1432179
Okay it here .

I made it fast so check it out and give some credit.

Option Explicit  '*** use it all the time

Private Sub cmdRead_Click()
  Dim LineOfText$
  Dim AllText$
  Dim Wrap$
  Dim MyLeftChr
 
  Wrap$ = Chr$(13) + Chr$(10)  'create wrap character
  'On Error Resume Next
 
  Open "c:\numbers.ssf" For Input As #1 ' make sure the Path is correct.
 
  Do Until EOF(1)
    Line Input #1, LineOfText
    MyLeftChr = Left(LineOfText, 1)
    'If IsNumeric(LineOfText$) Then
    If MyLeftChr <> "[" Then
        AllText = AllText & LineOfText & Wrap
    End If
   
Loop
Close #1

Text1.Text = AllText
MsgBox "Done Reading"
End Sub


0
 
LVL 3

Expert Comment

by:a111a111a111
ID: 1432180
You can download the project from
http://www.hili.com/~shay/filter.zip

0
 

Author Comment

by:jrProgrammer
ID: 1432181
okay!  you don't know how much this is helping!  I'm gonna raise the point value for ya.
0
 
LVL 3

Expert Comment

by:a111a111a111
ID: 1432182
Thank you much.

Again If you need more help email to shay@hili.com.

BTW you can find a nice VB section in my home page

http://www.hili.com/~shay

"Don't Crack too  much",,....



(in my Crack section...)

0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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 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…

752 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