Solved

Loading Data

Posted on 1998-08-31
14
178 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

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

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
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…
Suggested Courses
Course of the Month6 days, 11 hours left to enroll

634 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