Solved

How to convert a UnStructured data file  into a Structured file

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
using Access 8 68
Add a task in Outlook from access 11 39
vb6, excel Run-time error 1004 method 'close' of object 'workbooks' failed 7 54
vbModal 12 53
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

803 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