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
Solved

Loading Data

Posted on 1998-08-31
14
175 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
  • 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

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…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

837 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