Solved

How to convert a UnStructured data file  into a Structured file

Posted on 2002-05-26
4
171 Views
Last Modified: 2010-05-02
hi,
 In my project we r getting a unformated data file as an input.For our data processing i need to convert it into a structured one.Two samples of the unstructured file is given below.Please guide me. Advanced Thanks for ur kind suggestion.


FIRST ONE
----------

"SPEED of"""36.0"mph on day 14 at 14:59"

"Lull of"""12"hours ending on day 18 at 07:10"

"Velocity"
"  Range: (MPH)""""   00-06""   06-08""   08-10""   10-12""   12-14""   14-16""   16-18""   18-20""   20-22""   22-24""   24-26""   26-28""   28-30""   30-32""   32-34""   34-36""   36-38""    >>38"
"  Total:"""149 151 135 105  68  35  16   7   2   1   0   0   0   0   0   0   0   0

SECOND
------


"Speed of"""30.0"mph on day 19 at 19:39"
""
"Lull of""" 15"hours ending on day 15 at 16:23"
" "
"Velocity"
"  Range: (MPH)""""   00-06""   06-08""   08-10""   10-12""   12-14""   14-16""   16-18""   18-20""   20-22""   22-24""   24-26""   26-28""   28-30""   30-32""   32-34""   34-36""   36-38""    >>38"
"  Total:""" 234 149 113  87  55  30  15   7   3   1   0   0   0   0   0   0   0   0





0
Comment
Question by:asrah_su
4 Comments
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 7035190
Please maintain your open questions:
how to copy a picturebox image to msword Date: 03/26/2002 04:39AM PST
http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20281571
plot a wind rose diagram Date: 03/13/2002 11:24PM PST
http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20276764

Thanks,
Anthony
0
 
LVL 43

Accepted Solution

by:
TimCottee earned 50 total points
ID: 7036740
Having taken the data as you show it, this code will take the data in the file and display it on labels and textboxes. You can obviously do what you want with it by modifying this part and saving this information in a different format if required.

Dim intFHandle As Integer

Private Sub Command1_Click()
    Dim aryLines(1 To 8) As String
    For intLine = 1 To 8
        Line Input #intFHandle, aryLines(intLine)
    Next
    Label1(0).Caption = Replace(aryLines(1), Chr(34), "")
    Label1(1).Caption = Replace(aryLines(3), Chr(34), "")
    aryLines(6) = Replace(aryLines(6), Chr(34), "")
    aryLines(7) = Replace(aryLines(7), Chr(34), "")
    intItem = 0
    For intPos = 16 To Len(aryLines(6)) Step 8
        Label2(intItem).Caption = Mid(aryLines(6), intPos, 8)
        intItem = intItem + 1
    Next
    intItem = 0
    For intPos = 9 To Len(aryLines(7)) Step 4
        Text1(intItem).Text = Mid(aryLines(7), intPos, 4)
        intItem = intItem + 1
    Next
End Sub

Private Sub Form_Load()
    intFHandle = FreeFile()
    Open "c:\personal\other\testbed\asrah.txt" For Input As #intFHandle
End Sub

Private Sub Form_Unload(Cancel As Integer)
    Close #intFHandle
End Sub
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7818560
Hi asrah_su,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept TimCottee's comment(s) as an answer.

asrah_su, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 

Expert Comment

by:SpideyMod
ID: 7909976
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

762 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

21 Experts available now in Live!

Get 1:1 Help Now