Solved

How to convert a UnStructured data file  into a Structured file

Posted on 2002-05-26
4
174 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Access 2016 VB code 9 103
bit defender blocks good applications 2 83
Visual Studio search word table and return Cell index 8 49
Modifying Conditional Format from VBA code 3 49
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…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

863 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

27 Experts available now in Live!

Get 1:1 Help Now