I can't believe I have to post for help on this issues, but after three days, I give up.

Here is a sample of the text I am trying to parse:

Berlinda Girl Newmarket Lord, army; shield 54 + Soccer Berlindis Girl Newmarket Lord, army; shield 32 + Football
Well I want to read a text file wiht this information, then place each tab separated item into a separate part of the array so I can do some work, then dump it out with all the without any extra tabs. Right now I get the text I need, but with a bunch of extra tabs and other informatio I would rather not have.

Here is my code:

ProcessRedFile(); sub ProcessRedFile { open (READ, "dump.txt"); $Counter=(); open (OUT, ">/Users/simondyates/Desktop/OutFile.txt"); @File =<READ>; foreach $File(@File) { @Format = split(/ *\s\s */,$File); push (@Finish, @Format); } } $x=0; print OUT "\t"; $x=0; while ($x<200) { @Test = split(/\t/,$Finish[$x]); push (@Test2, @Test); $x++; } @Finish = @Test2; while ($x<200) { if ($f eq 1) { print OUT "$Finish[$x]\t"; } elsif ( $f eq 2) { print OUT "$Finish[$x]\t"; } elsif ( $f eq 4) { print OUT "$Finish[$x]\t"; } elsif ( $f eq 5) { print OUT "$Finish[$x]\t"; } elsif ( $f eq 8) { print OUT "\n"; $f=0; } $x=$x+1; $f++; } close READ; close OUT;

In reply to Parsing simple text, made difficult by sdyates

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.