Extract lines from file, add to new files

Piergiorgio Sartor piergiorgio.sartor.this.should.not.be.used at nexgo.REMOVETHIS.de
Thu Jan 11 13:23:32 EST 2024


On 11/01/2024 19.08, Rich Shepard wrote:
> It's been several years since I've needed to write a python script so I'm
> asking for advice to get me started with a brief script to separate names
> and email addresses in one file into two separate files: salutation.txt and
> emails.txt.
> 
> An example of the input file:
> 
> Calvin
> calvin at example.com
> 
> Hobbs
> hobbs at some.com
> 
> Nancy
> nancy at herown.com
> 
> Sluggo
> sluggo at another.com
> 
> Having extracted salutations and addresses I'll write a bash script using
> sed and mailx to associate a message file with each name and email address.

Why not to use bash script for all?

bye,

-- 

piergiorgio



More information about the Python-list mailing list