By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,661 Members | 779 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,661 IT Pros & Developers. It's quick & easy.

tuples reading issue

P: 12
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
Mar 3 '15 #1
Share this Question
Share on Google+
1 Reply


bvdet
Expert Mod 2.5K+
P: 2,851
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.
Expand|Select|Wrap|Line Numbers
  1. lineList = open(filename).readlines()
  2. lines = open(filename).read()
Mar 3 '15 #2

Post your reply

Sign in to post your reply or Sign up for a free account.