Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Okay, here is what I am trying to do. I need to read in the data beginning after "TTY" and read this in until the next "TTY" or "EOS", my dilemma is how do I do that?

Please oh please wise monks brothers and sisters, help me if you can...

Here is the file that I am trying to read in...

"TTY" "A1" "" "CBI" "*********************************** APPLICANT-C1 ****** +*********************************** EQUIFAX 5.0 for application 4309 *526 EQUIFAX CREDIT INFORMATION SERVICES P O BOX 740241 1150 LAKE HEARN DRIVE STE 460 ATLANTA GA 303740241 + (800) 685-1111 BEACON: 623 00022-ACCOUNT NOT PAID AS AGREED, PUBLIC RECORD, OR COLLECTION AGENC +Y FILLING 00018-NUMBER OF ACCOUNTS CURRENTLY OR IN THE PAST NOT PAID AS AGREED 00010-RLTNSHP OF BALANCE TO HIGH CREDIT ON BANK/NAT OR OTHER REVOLVI +NG/OPEN ACCTS 00013-LENGTH OF TIME (OR UNKNOWN TIME) SINCE ACCT PD AS AGREED OR TR +ADE NARR RPTD D.A.S. SCORE: (CENTRAL MODEL): 704 08023-NUMBER OF ACCOUNTS SHOWING PAYMENT LATE BY 90 DAYS OR MORE / P +UBLIC RECORD ITEMS END OF REPORT EQUIFAX AND AFFILIATES 08/29/01 SAFESCANNED. *********************************** APPLICANT-, FILE-0 *************** +******************** END OF REPORT EQUIFAX AND AFFILIATES 08/29/01 SAFESCANNED. " "TTY" etc....
I am reading in this file as though it were all on one line, but it is not coming from my project that way. Here is the code that I am using...
elsif (/"TTY"/) { $TTY_Ind = 1; $toggle = 34, next if /^"TTY"\s*$/; } last if /"EOS"/;
How can I get this to read the data in and not worry about the data running onto the next line. I want you to know that if I go in the vi editor and delete all the end of line characters (of which I cannot see - they are mysterious), I can get this file read in perfectly. Please help me with this if you have knowledge. I am racking and racking and racking my brain on this one. PS Don't panic on the information in here it is all false...

peace, LOVE and ((code))

basicdez

In reply to Help with Reading in of a flat file... by basicdez

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-04-23 09:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found