Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to convert a UnStructured data file  into a Structured file

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

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…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

610 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