Extract lines from file, add to new files

avi.e.gross at gmail.com avi.e.gross at gmail.com
Mon Jan 29 12:57:37 EST 2024


Rich,

You got an overly general reply to a question many of us may not understand.

You have not hinted at how the two files are organized, perhaps with an
example.

There are several general solutions that may apply. Some involve reading in
both files into data structures and perhaps linking them together in some
way such as a data.frame or binary tree. You can then process individual
request in memory/

The second should be straightforward as long as text is text. If the first
file tells you to search for XYZ then you search the second file for XYZ and
read in whatever is associated with it and do your thing.

Without a bit more specific detail, you may not get more than a suggestion
as to how to read in files.


-----Original Message-----
From: Python-list <python-list-bounces+avi.e.gross=gmail.com at python.org> On
Behalf Of Rich Shepard via Python-list
Sent: Monday, January 29, 2024 12:38 PM
To: python-list at python.org
Subject: RE: Extract lines from file, add to new files

On Mon, 29 Jan 2024, Rich Shepard via Python-list wrote:

> No, I hadn't ... but I am reading it now.

Perhaps I missed the answer to my question when reading the io module. It
explains how to open/write/read files of text and binary data, not passing
a variable's value from one file to a place-keeper in another file.

I'll keep searching for a solution.

Rich
-- 
https://mail.python.org/mailman/listinfo/python-list



More information about the Python-list mailing list