[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.2

Script required to parse a text file using Perl

Asked by LeeGolding in Perl Programming Language

Tags: perl, file, parse, script

Hi friends,

I'm looking for a script to pull out the following information from a text file and write to a CSV file:

Product Name
Product NameShort
Product Number
Product Category

For an example from the text below would be:

firecare 14 zone labels,firecare 14 zone labels,MSC023173,PvC Label
Securitech 6 window keypad label, Securitech 6 window key,MSC023192,Keypad Label

If the product category or product number is empty in the source file, it can be written to the output file as an empty column. I.e.

Securitech 700 lid 2 colour,Securitech 700 lid 2 co,,


The link to the full text file is:

http://myweb.tiscali.co.uk/leegolding/work/file.txt


Thanks,

Lee.

-------------------------------------------------------------------------------------------------------
„‡±                 ú   Challenger labels Mr J Newey                                               Specials               (                        i  i                   þ   firecare 14 zone labels              firecare 14 zone labelsMSC023173      Pvc Label              ü                        i  i                         þ   Firetech 14 zone label               Firetech 14 zone label MSC023120      Pvc Label              ü                        i  i    
               þ         Tate TS1 lid                         Tate TS1 lid           COM 1          Plastic Lid            5                        i  i                    þ
   Tate TS2 lid                         Tate TS2 lid           COM 2          Plastic Lid            5                        i  i                    þ    Ademco A4 spanish                    Ademco A4 spanish      COM 3          Plastic Lid            5                        i  i                                                                                      P‘1µ  
               þ    Securitech Active 5                  Securitech Active 5    COM 4          Plastic Lid            %                        i  i                   þ
   Securitech active 5 lid                                     COM 4         CPlastic Lid            %                        m  m                   þ   Bravo 700 lid French                 Bravo 700 lid French   COM 5          Plastic Lid                                   m  m                   þ   Bravo 700 window label french        Bravo 700 window label MSC023183      Plastic Lid Label      `                        m  m                   ö   CA67 window label                    CA67 window label      MSC023157                             `                        m  m                   ö   Ademco 4 window label spanish        Ademco 4 window label sMSC023168                             `                        m  m                                                                                      M…‡±                 þ   Bravo instructions french            Bravo instructions frenMSC023189      Plastic Lid Instruct   `                        m  m                   þ   Active 5 window label                Active 5 window label  MSC023140      Plastic Lid Label      <                        m  m                   þ   CA67 lid                             CA67 lid               COM 6          Plastic Lid            •                       m  m                   þ   Ademco 5 lid                         Ademco 5 lid           COM 7          Plastic Lid                                   m  m                   þ   Active 5 lid                         Active 5 lid           COM 8          Plastic Lid            r                       m  m                   þ   Tate TBP 4Z lid                      Tate TBP 4Z lid        COM 9          Plastic Lid            Ì                       m  m                                                                                      áx­¸                 ö   Tate TBP 4Z window label             Tate TBP 4Z window labeMSC023145                             `                        m  m                   ö   Securitech active 5 operating instruction                   MSC023193                             <            P          m  m                   þ   Securitech 6 window keypad label     Securitech 6 window keyMSC023192      Keypad Label                                  m  m                   þ   Securitech 5 window keypad label     Securitech 5 window keyMSC023187      Keypad Label           à           ®         m  m                   ö   Securitech 700 lid 2 colour          Securitech 700 lid 2 coCOM 10                                â                       m  m                   þ   Securitech active 5 french           Securitech active 5 freMSC023186      Plastic Lid            l                       m  m                                                                                      ޹                 ö   Countess italian                     Countess italian       MSC023111                             "                       m  m                    þ   Colin Lee posters                    Colin Lee posters      HA 001         Window Posters         œ                       m  m    !               þ    Flashguard 139x250 label                                    ASG 001        White On Clear                                m  m    "               þ!   ASG Midland label small              ASG Midland label smallASG 002        White On Clear         ´                        m  m    #               þ"   R H bell label 3" x 7"               R H bell label 3" x 7" ASG 003        Red On Clear           h                       m  m    $               þ#   Rover plates                         Rover plates           MP 001         Metal Plates           ö                       m  m                                                                                      Ów­¸  %               þ$   Pathfinder lettering                 Pathfinder lettering   PFM 001        Computer Cut           L                       m  m    &               þ%   FPP14 english CEF label              FPP14 english CEF labelLP1 3016       Pvc Label              š                        m  m    '               ö&   240v mains english label             240v mains english labeLM1 0240                                                      m  m    (               þ'   FPE english CEF label                FPE english CEF label  LP1 1003       Pvc Label              P                       m  m    )               ö(   Black signs , Ladies and/or Gents    Black signs , Ladies anEE 001                                "                        m  m    *               ö)   Black sign Ladies/Gents                                     EE 001        E                       Є                       m  m                                                                                      .³¹  +               ö*   Clinical waste label black&red/yello Clinical waste label blWL 001                                F                       n  n    ,               þ+   Triangle label 135x135x135           Triangle label 135x135xWL 002         Warning Label                                 n  n    -               þ,   Leasecontract window label                                  M2 001         Vinyl Label            Š                        n  n    .               ö-   PAVA PV210 label                     PAVA PV210 label       ML 001                                $                       n  n    /               þ.   Watmoughs label 20"x3"               Watmoughs label 20"x3" SP 001         Vinyl Label            Ì                       n  n    0               þ/   Boxer label 50 kg                                           ML 002         Vinyl Label            Î                       n  n                                                                                      C÷/¹  1               þ0   Appollo plates                       Appollo plates         CE 001         Metal Plates           r                       n  n    2               þ1   Karate label                         Karate label           WL 003         Window Sticker         ê                       n  n    3               þ2   Gog Magog label                      Gog Magog label        WL 004         Vinyl Label            I                        n  n    4               þ3   Sale sign                            Sale sign              SAX 001        Poster Sign            7                       n  n    5               þ4   Durr label                           Durr label             WL 005         Plastic Plates         0                       n  n    6               þ5   Davison label                        Davison label          WL 006         Vinyl Label                                    n  n                                                                                      tº  7               ö6   Bell housing horizontal              Bell housing horizontalHOR02                                 Ò                        n  n    8               ö7   Bell housing vertical                Bell housing vertical  VERT01                                ë                        n  n    9               æ8   Postage&packing                                             POST                                                            n  n    :               ö9   labels                               labels                 MAG 01                                ¦                        n  n    ;               æ:   Positives                            Positives              POS+                                                            n  n    <               ö;   Printed alluminium plates            Printed alluminium platSES 001                               X                       n  n                                                                                      ëg´  =               þ<   Maintenance stickers                 Maintenance stickers   SES 002        Vinyl Stickers         ô                       n  n    >               þ=   Speed control plates                 Speed control plates   SES 003        Alluminium Plates      ª                       n  n    ?               þ>   Reconditioned plates                                        SES001        SAlluminium Plates      X                       n  n    @               þ?   Land Rover oval. Sheet 10.                                  MAP 001        Stickers               D                       n  n    A               æ@   metal plates                         metal plates           MP001                                                           n  n    B               þA   Active 4 lid french                  Active 4 lid french    COM 11         Plastic Lid                                   n  n                                                                                      †‡±  C               öJ   Rascal label french                  Rascal label french    MSC023151                             l                       n  n    D               þC   Bio Rinz label                                              MGS 001        Vinyl Label            °                        n  n    E               öD   Securitech active 5X french window label                    MSC023182                             `                        n  n    F               öE   Active 5X lid french                                        COM 12        C                       Ì                       n  n    G               öF   Active 4 window label french                                MSC023184                             `                        n  n    H               öG   Tate 4 zone english                  Tate 4 zone english    MSC023054                                                    n  n                                                                                      š…‡±  I               öH   Active 4 lid english                 Active 4 lid english   COM 13                                Ì                       n  n    J               öI   Active 4 window label english        Active 4 window label eMSC023146                             `                        n  n    K               öK   Envoy 5 label                        Envoy 5 label          MSC023194                             l                       n  n    L               þL   Simplon label                        Simplon label          ST 001         Roll Label             <                        o  o    M               þM   Imobiliza label                      Imobiliza label        CT 001         Vinyl Label            R                        o  o    N               öN   Visi bell label                      Visi bell label        LUS 001                               ¨                       o  o                                                                                      ¸F¥º  O               þO   Subaru label                         Subaru label           JSP 001        Static Label           •                        o  o    P               þP   Seat numbers                         Seat numbers           SLC 001        Vinyl                  (                        o  o    Q               þQ   QVA label                            QVA label              SLC 002        Vinyl Label            €                       o  o    R               þR   Marine pollutant label large         Marine pollutant label DL 001         Vinyl Label            Ö                        o  o    S               þS   2 colour tanker haz chem                                    DL 003         Vinyl Label            L                       o  o    T               þT   Stop that leak label                 Stop that leak label   DL 004         Styrene Label          Ð                        o  o                                                                                      XI¾  U               æU   cut job                                                     CUT                                                             o  o    V               æV   Styrene 1.5mm matt/matt              Styrene 1.5mm matt/mattPLAS                                                            t  t    W               öW   Todays Hot Soup label                Todays Hot Soup label  VBO 001                               ô                             X               öX   S00043 magnet label                  S00043 magnet label    SF 001                                &                              Y               öY   Summerhill fire notice A4            Summerhill fire notice AP 001                                æ                              Z               öZ   Rusty chain label                    Rusty chain label      AP 002                                Ü                                                                                                               
---------------------------------------------------------------------------
[+][-]09/15/05 11:00 PM, ID: 14895720Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Perl Programming Language
Tags: perl, file, parse, script
Sign Up Now!
Solution Provided By: ozo
Participating Experts: 3
Solution Grade: A
 
[+][-]09/15/05 12:42 PM, ID: 14892709Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/15/05 01:00 PM, ID: 14892891Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/15/05 01:05 PM, ID: 14892964Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/15/05 03:20 PM, ID: 14893901Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/15/05 03:52 PM, ID: 14894045Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/15/05 03:55 PM, ID: 14894058Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/15/05 04:02 PM, ID: 14894087Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/15/05 04:16 PM, ID: 14894147Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/15/05 04:22 PM, ID: 14894169Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/15/05 04:27 PM, ID: 14894194Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]09/15/05 04:28 PM, ID: 14894196Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/15/05 04:35 PM, ID: 14894227Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/15/05 04:35 PM, ID: 14894229Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/15/05 04:36 PM, ID: 14894235Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/15/05 04:39 PM, ID: 14894250Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/15/05 08:53 PM, ID: 14895322Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/15/05 09:44 PM, ID: 14895496Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/16/05 04:12 AM, ID: 14896949Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/16/05 10:23 AM, ID: 14899871Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/16/05 11:28 AM, ID: 14900293Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/16/05 03:33 PM, ID: 14901958Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/16/05 06:02 PM, ID: 14902399Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92