Jump to content

Here is another program installment


G+_jerry coffey
 Share

Recommended Posts

Here is another program installment.

This one solves a need I had at work, taking a pipe delimited file from a library program and extracting the publication year, call number and title field to output as one pipe delimited line each. So it could be opened in excel .

 

I had to step outside the current commands talked about but I tried to stay close. Hope I added enough comments to make it clear what I am up to.

 

The file is 8500 line long and my first try only found 150. :(

I had tried to use "with" and had something wrong.

I finally settled on the "for Line in record:" to loop and that worked.

There is also a file 

https://github.com/jcoffey42/coding101/blob/master/catalog2.txt

that has two of the records for testing.

 you will have to change the file locations to match where you have put the file.

 

Here is a "B" version that allows you to enter the file names without editing the code.

https://github.com/jcoffey42/coding101/blob/master/projec%202014-P003b

https://github.com/jcoffey42/coding101/blob/master/project2014-P003

Link to comment
Share on other sites

 Share

×
×
  • Create New...