Solved

Loading Data

Posted on 1998-08-31
14
170 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
 
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
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…

758 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

23 Experts available now in Live!

Get 1:1 Help Now