Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 184
  • Last Modified:

Loading Data

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
jrProgrammer
Asked:
jrProgrammer
  • 10
  • 4
1 Solution
 
a111a111a111Commented:
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
 
a111a111a111Commented:
What Version of Visual Basic are ou using.
I can make a program for you in VB 3.0 or VB 5.0.

0
 
jrProgrammerAuthor Commented:
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
a111a111a111Commented:
Yes thats it...
Coming soon.
0
 
a111a111a111Commented:
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
 
a111a111a111Commented:
jrProgrammer.

You can download the complete project form
http://www.hili.com/~shay/numbers.zip
0
 
a111a111a111Commented:
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
 
jrProgrammerAuthor Commented:
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
 
a111a111a111Commented:
Okay I am working on this one as well.

in a few you get the code.
0
 
jrProgrammerAuthor Commented:
okay!  you don't know how much this is helping!  I'm gonna raise the point value for ya.
0
 
a111a111a111Commented:
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
 
a111a111a111Commented:
You can download the project from
http://www.hili.com/~shay/filter.zip

0
 
jrProgrammerAuthor Commented:
okay!  you don't know how much this is helping!  I'm gonna raise the point value for ya.
0
 
a111a111a111Commented:
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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

  • 10
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now