tuples reading issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Raj4perl
    New Member
    • Aug 2014
    • 12

    tuples reading issue

    Hi,

    Can you help me with this

    File contains first 500 lines. each has a header around 3 pages then you may find footer with some column names like "Total,..."

    Image contains actual data. I need to split the file with respect to pages & account num (can get the account from each page 10 line)

    I have written a udf which reads tuples of the whole file and gets the output as bag {(accnt num), (page no), (page content)}

    My problem when i load its reading each line as one tuple.


    Thanks,
    Raj
  • bvdet
    Recognized Expert Specialist
    • Oct 2006
    • 2851

    #2
    Care to post your function, maybe a sample of the file you are trying to parse? Opening and reading a file into memory as a list of lines or a long string is pretty simple.
    Code:
    lineList = open(filename).readlines()
    lines = open(filename).read()

    Comment

    Working...