?
Solved

How to convert a UnStructured data file  into a Structured file

Posted on 2002-05-26
4
Medium Priority
?
196 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
[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
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 200 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

Industry Leaders: 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!

Question has a verified solution.

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

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Suggested Courses

777 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