Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #21547 > unrolled thread
| Started by | "Prasad, Ramit" <ramit.prasad@jpmorgan.com> |
|---|---|
| First post | 2012-03-12 21:09 +0000 |
| Last post | 2012-03-12 21:09 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
RE: Fast file data retrieval? "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-03-12 21:09 +0000
| From | "Prasad, Ramit" <ramit.prasad@jpmorgan.com> |
|---|---|
| Date | 2012-03-12 21:09 +0000 |
| Subject | RE: Fast file data retrieval? |
| Message-ID | <mailman.596.1331586564.3037.python-list@python.org> |
> > header line > > 9 nonblank lines with alphanumeric data > > header line > > 9 nonblank lines with alphanumeric data > > ... > > ... > > ... > > header line > > 9 nonblank lines with alphanumeric data > > EOF > > > > where, a data set contains 10 lines (header + 9 nonblank) and there can > > be several thousand > > data sets in a single file. In addition,*each header has a* *unique ID > > code*. > Alternatively, you could scan the file, recording the ID and the file > offset in a dict so that, given an ID, you can seek directly to that > file position. If you can grep for the header lines you can retrieve the headers and the line number for seeking. grep is (probably) faster than python so I would have it be 2 steps. 1. grep > temp.txt 2. python; check if ID is in temp.txt and then processes Ramit Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology 712 Main Street | Houston, TX 77002 work phone: 713 - 216 - 5423 -- This email is confidential and subject to important disclaimers and conditions including on offers for the purchase or sale of securities, accuracy and completeness of information, viruses, confidentiality, legal privilege, and legal entity disclaimers, available at http://www.jpmorgan.com/pages/disclosures/email.
Back to top | Article view | comp.lang.python
csiph-web