I have a flat file exported from a database in what was supposed to be .CSV but I am not sure if it really is.
I have posted an example of a help desk ticket this file contains. There are about 7000 tickets in one file in the same format as a long list (flat file).
I want a Perl script or something (I am just learning PERL, knowing that it will be my number one administration tool someday when I have learned it) that will look through the file and do this; Take the field names listed below:
Request Number
Affected User
Reported By
Assignee
Request Area
Open Date
Description
History (this one needs to be some kind of format that allows the capture of all the data under it, like memo does in access.
And either make a database or insert it into an Access Table in an Access Database, and also insert the data following each field, as the value of the field, and make it as one record by Request Number.
I imagine there are many ways to do this, but I cannot do it with things like importing into Access, it just does not have the ability to delimit it based on the : character which I already tried.
From What I hear about Perl is that it can do this for me.
Can someone show me the script that I can use or send me to the right rescource that matches this type of example the closest. I am being diligent to try and learn myself but I have been reading books for the past two days and I am not sure yet where to start.
Thanks for your help.
Here it the format of the file. If you clip and paste it in notepad or some other text editor it might be more exact.
As Of: 01
+/22/2004
Requests
Request Number: 262944 Parent : Prio
+rity:4-Med
Status: Closed Active :No
Affected User: Smith, Jane Impa
+ct :None
Reported By: Doe, John Template: Urge
+ncy :
Assignee: Doe, Jane SLA Violation:0 Seve
+rity:
Group Asgd. To: IT-Group Service :Empty
+
Change:
Request Area: Acc-Grp
Root Cause:
Affected Asset: ChargeBack:
Open Date: 12/31/2002 Close Date:1/03/2003
Resolve Date: Time Spent:0 days 0 hours 1
+ minutes
Last Modified: 3/27/2003
End User ID:
Phone Number: 3363 Alt Phone :
+
Fax Number: Timezone :
+
Summary: EMAIL I need authorization to XXX. That's a letter o
+not...
Description: EMAIL I need authorization to XXX. That's a letter o
+not a
number zero.
+
+
(email) Sorry, I need this in TST and/or DEV
+
History
Analyst Date Time Spent Type
----------------------------------------------------------------------
+----------
Doe, John 12/31/2002 0 minutes 47 seconds Initial
Desc:create a new request/change order
+
Doe, John 12/31/2002 0 minutes 5 seconds Log Comment
Desc:(email) OK
+
Doe, John 12/31/2002 0 minutes 7 seconds Close
Reques
+t/Change
Order
+
Desc:(email) Jane, the change should take effect the
+ next
time you log on.
+
+
+
You may close this ticket.
+
Doe, John 1/02/2003 0 minutes 4 seconds Log Comment
Desc:(email) It is not working
+
Doe, John 1/02/2003 0 minutes 0 seconds Reopen
Desc:Status changed from 'Closed' to 'Open'
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.