diff --git a/bpl/1961b/1-in/bpl-1961b-letter.txt b/bpl/1961b/1-in/bpl-1961b-letter.txt new file mode 100644 index 0000000..21d3448 --- /dev/null +++ b/bpl/1961b/1-in/bpl-1961b-letter.txt @@ -0,0 +1,413 @@ +1961 Letter + +BUFFETT PARTNERSHIP, LTD. + +810 KIEWIT PLAZA + +OMAHA 31, NEBRASKA + +January 24, 1962 + +Our Performance in 1961 + +I have consistently told partners that it is my expectation and hope (it's always hard to tell which is which) that +we will do relatively well compared to the general market in down or static markets, but that we may not look so +good in advancing markets. In strongly advancing markets I expect to have real difficulty keeping up with the +general market. + +Although 1961 was certainly a good year for the general market, and in addition, a very good year for us on both +an absolute and relative basis, the expectations in the previous paragraph remain unchanged. + +During 1961, the general market as measured by the Dow-Jones Industrial Average (hereinafter called the +“Dow”) showed an over-all gain of 22.2% including dividends received through ownership of the Dow. The +gain for all partnerships operating throughout the entire year, after all expenses of operation, but before +payments to limited partners or accrual to the general partner, averaged 45.9%. The details of this gain by +partnership are shown in the appendix along with results for the partnerships started during the year. + +We have now completed five full years of partnership operation, and the results of these five years are shown +below on a year-by-year basis and also on a cumulative or compounded basis. These results are stated on the +basis described in the preceding paragraph; after expenses, but before division of gains among partners or +payments to partners. + +[TABLE] +Year & Partnerships Operating Entire Year & Partnership Gain & Dow-Jones Industrials Gain* +1957 3 10.4% -8.4% +1958 5 40.9% 38.5% +1959 6 25.9% 19.9% +1960 7 22.8% -6.3% +1961 7 45.9% 22.2% +[/TABLE] + +* Including dividends received through ownership of the Dow. + +On a compounded basis, the cumulative results have been: + +[TABLE] +Year & Partnership Gain & Dow-Jones Industrials Gain +1957 10.4% -8.4% +1957-58 55.6% 26.9% +1057-59 95.9% 52.2% +1957-60 140.6% 42.6% +1957-61 251.0% 74.3% +[/TABLE] + +These results do not measure the gain to the limited partner, which of course, is the figure in which you are most +interested. Because of the varying partnership arrangements that have existed in the past, I have used the over- +all net gain (based on market values at the beginning and end of the year) to the partnership as being the fairest +measure of over-all performance. + +On a pro-forma basis adjusted to the division of gains entailed in our present Buffett Partnership, Ltd. +agreement, the results would have been: + +[TABLE] +Year & Limited Partners’ Gain & Dow Gain +1957 9.3% -8.4% +1958 32.2% 38.5% +1959 20.9% 19.9% +1960 18.6% -6.3% +1961 35.9% 22.2% +[/TABLE] + +COMPOUNDED + +[TABLE] +Year & Limited Partners’ Gain & Dow Gain +1957 9.3% -8.4% +1957-58 44.5% 26.9% +1957-59 74.7% 52.2% +1957-60 107.2% 42.6% +1957-61 181.6% 74.3% +[/TABLE] + +A Word About Par + +The outstanding item of importance in my selection of partners, as well as in my subsequent relations with them, +has been the determination that we use the same yardstick. If my performance is poor, I expect partners to +withdraw, and indeed, I should look for a new source of investment for my own funds. If performance is good, I +am assured of doing splendidly, a state of affairs to which I am sure I can adjust. + +The rub, then, is in being sure that we all have the same ideas of what is good and what is poor. I believe in +establishing yardsticks prior to the act; retrospectively, almost anything can be made to look good in relation to +something or other. + +I have continuously used the Dow-Jones Industrial Average as our measure of par. It is my feeling that three +years is a very minimal test of performance, and the best test consists of a period at least that long where the +terminal level of the Dow is reasonably close to the initial level. + +While the Dow is not perfect (nor is anything else) as a measure of performance, it has the advantage of being +widely known, has a long period of continuity, and reflects with reasonable accuracy the experience of investors +generally with the market. I have no objection to any other method of measurement of general market +performance being used, such as other stock market averages, leading diversified mutual stock funds, bank +common trust funds, etc. + +You may feel I have established an unduly short yardstick in that it perhaps appears quite simple to do better +than an unmanaged index of 30 leading common stocks. Actually, this index has generally proven to be a +reasonably tough competitor. Arthur Wiesenberger’s classic book on investment companies lists performance +for the 15 years 1946-60, for all leading mutual funds. There is presently over $20 billion invested in mutual +funds, so the experience of these funds represents, collectively, the experience of many million investors. My +own belief, though the figures are not obtainable, is that portfolios of most leading investment counsel +organizations and bank trust departments have achieved results similar to these mutual funds. + +Wiesenberger lists 70 funds in his “Charts & Statistics” with continuous records since 1946. I have excluded 32 +of these funds for various reasons since they were balanced funds (therefore not participating fully in the general +market rise), specialized industry funds, etc. Of the 32 excluded because I felt a comparison would not be fair, +31 did poorer than the Dow, so they were certainly not excluded to slant the conclusions below. + +Of the remaining 38 mutual funds whose method of operation I felt was such as to make a comparison with the +Dow reasonable, 32 did poorer than the Dow, and 6 did better. The 6 doing better at the end of 1960 had assets +of about $1 billion, and the 32 doing poorer had assets of about $6-1/2 billion. None of the six that were superior +beat the Dow by more than a few percentage points a year. + +Below I present the year-by-year results for our period of operation (excluding 1961 for which I don't have exact +data, although rough figures indicate no variance from the 1957-60 figures) for the two largest common stock +open-end investment companies (mutual funds) and the two largest closed-end investment companies: + +[TABLE] +Year & Mass Inv Trust & Investors Stock & Lehman & Tri-Cont & Dow & Limited Partners +1957 -12.0% -12.4% -11.4% -2.4% -8.4% 9.3% +1958 44.1% 47.6% 40.8% 33.2% 38.5% 32.2% +1959 8.2% 10.3% 8.1% 8.4% 19.9% 20.9% +1960 -0.9% -0.1% 2.6% 2.8% -6.3% 18.6% +[/TABLE] + +(From Moody’s Banks & Finance Manual, 1961) + +COMPOUNDED (Gains From the Previous Table) + +[TABLE] +Year & Mass Inv Trust & Investors Stock & Lehman & Tri-Cont & Dow & Limited Partners +1957 -12.0% -12.4% -11.4% -2.4% -8.4% 9.3% +1957-58 26.8% 29.3% 24.7% 30.0% 26.9% 44.5% +1957-59 37.2% 42.6% 34.8% 40.9% 52.2% 74.7% +1957-60 36.0% 42.5% 38.3% 44.8% 42.6% 107.2% +[/TABLE] + +Massachusetts Investors Trust has net assets of about $1.8 billion; Investors Stock Fund about $1 billion; Tri +-Continental Corporation about $ .5 billion; and Lehman Corporation about $350 million; or a total of over $3.5 +billion. + +I do not present the above tabulations and information with the idea of indicting investment companies. My own +record of investing such huge sums of money, with restrictions on the degree of activity I might take in +companies where we had investments, would be no better, if as good. I present this data to indicate the Dow as +an investment competitor is no pushover, and the great bulk of investment funds in the country are going to have +difficulty in bettering, or perhaps even matching, its performance. + +Our portfolio is very different from that of the Dow. Our method of operation is substantially different from that +of mutual funds. + +However, most partners, as all alternative to their investment in the partnership, would probably have their funds +invested in a media producing results comparable to the Dow, therefore, I feel it is a fair test of performance. + +Our Method of Operation + +Our avenues of investment break down into three categories. These categories have different behavior +characteristics, and the way our money is divided among them will have an important effect on our results, +relative to the Dow in any given year. The actual percentage division among categories is to some degree +planned, but to a great extent, accidental, based upon availability factors. + +The first section consists of generally undervalued securities (hereinafter called "generals") where we have +nothing to say about corporate policies and no timetable as to when the undervaluation may correct itself. Over +the years, this has been our largest category of investment, and more money has been made here than in either of +the other categories. We usually have fairly large positions (5% to 10% of our total assets) in each of five or six +generals, with smaller positions in another ten or fifteen. + +Sometimes these work out very fast; many times they take years. It is difficult at the time of purchase to know +any specific reason why they should appreciate in price. However, because of this lack of glamour or anything +pending which might create immediate favorable market action, they are available at very cheap prices. A lot of +value can be obtained for the price paid. This substantial excess of value creates a comfortable margin of safety +in each transaction. This individual margin of safety, coupled with a diversity of commitments creates a most +attractive package of safety and appreciation potential. Over the years our timing of purchases has been +considerably better than our timing of sales. We do not go into these generals with the idea of getting the last +nickel, but are usually quite content selling out at some intermediate level between our purchase price and what +we regard as fair value to a private owner. + +The generals tend to behave market-wise very much in sympathy with the Dow. Just because something is cheap +does not mean it is not going to go down. During abrupt downward movements in the market, this segment may +very well go down percentage-wise just as much as the Dow. Over a period of years, I believe the generals will +outperform the Dow, and during sharply advancing years like 1961, this is the section of our portfolio that turns +in the best results. It is, of course, also the most vulnerable in a declining market. + +Our second category consists of “work-outs.” These are securities whose financial results depend on corporate +action rather than supply and demand factors created by buyers and sellers of securities. In other words, they are +securities with a timetable where we can predict, within reasonable error limits, when we will get how much and +what might upset the applecart. Corporate events such as mergers, liquidations, reorganizations, spin-offs, etc., +lead to work-outs. An important source in recent years has been sell-outs by oil producers to major integrated oil +companies. + +This category will produce reasonably stable earnings from year to year, to a large extent irrespective of the +course of the Dow. Obviously, if we operate throughout a year with a large portion of our portfolio in work- +outs, we will look extremely good if it turns out to be a declining year for the Dow or quite bad if it is a strongly +advancing year. Over the years, work-outs have provided our second largest category. At any given time, we +may be in ten to fifteen of these; some just beginning and others in the late stage of their development. I believe +in using borrowed money to offset a portion of our work-out portfolio since there is a high degree of safety in +this category in terms of both eventual results and intermediate market behavior. Results, excluding the benefits +derived from the use of borrowed money, usually fall in the 10% to 20% range. My self-imposed limit regarding +borrowing is 25% of partnership net worth. Oftentimes we owe no money and when we do borrow, it is only as +an offset against work-outs. + +The final category is "control" situations where we either control the company or take a very large position and +attempt to influence policies of the company. Such operations should definitely be measured on the basis of +several years. In a given year, they may produce nothing as it is usually to our advantage to have the stock be +stagnant market-wise for a long period while we are acquiring it. These situations, too, have relatively little in +common with the behavior of the Dow. Sometimes, of course, we buy into a general with the thought in mind +that it might develop into a control situation. If the price remains low enough for a long period, this might very +well happen. If it moves up before we have a substantial percentage of the company's stock, we sell at higher +levels and complete a successful general operation. We are presently acquiring stock in what may turn out to be +control situations several years hence. + +Dempster Mill Manufacturing Company + +We are presently involved in the control of Dempster Mill Manufacturing Company of Beatrice, Nebraska. Our +first stock was purchased as a generally undervalued security five years ago. A block later became available, and +I went on the Board about four years ago. In August 1961, we obtained majority control, which is indicative of +the fact that many of our operations are not exactly of the "overnight" variety. + +Presently we own 70% of the stock of Dempster with another 10% held by a few associates. With only 150 or so +other stockholders, a market on the stock is virtually non-existent, and in any case, would have no meaning for a +controlling block. Our own actions in such a market could drastically affect the quoted price. + +Therefore, it is necessary for me to estimate the value at yearend of our controlling interest. This is of particular +importance since, in effect, new partners are buying in based upon this price, and old partners are selling a +portion of their interest based upon the same price. The estimated value should not be what we hope it would be +worth, or what it might be worth to an eager buyer, etc., but what I would estimate our interest would bring if +sold under current conditions in a reasonably short period of time. Our efforts will be devoted toward increasing +this value, and we feel there are decent prospects of doing this. + +Dempster is a manufacturer of farm implements and water systems with sales in 1961 of about $9 million. +Operations have produced only nominal profits in relation to invested capital during recent years. This reflected +a poor management situation, along with a fairly tough industry situation. Presently, consolidated net worth +(book value) is about $4.5 million, or $75 per share, consolidated working capital about $50 per share, and at +yearend we valued our interest at $35 per share. While I claim no oracular vision in a matter such as this, I feel +this is a fair valuation to both new and old partners. Certainly, if even moderate earning power can be restored, a +higher valuation will be justified, and even if it cannot, Dempster should work out at a higher figure. Our +controlling interest was acquired at an average price of about $28, and this holding currently represents 21% of +partnership net assets based on the $35 value. + +Of course, this section of our portfolio is not going to be worth more money merely because General Motors, +U.S. Steel, etc., sell higher. In a raging bull market, operations in control situations will seem like a very +difficult way to make money, compared to just buying the general market. However, I am more conscious of the +dangers presented at current market levels than the opportunities. Control situations, along with work-outs, +provide a means of insulating a portion of our portfolio from these dangers. + +The Question of Conservatism + +The above description of our various areas of operation may provide some clues as to how conservatively our +portfolio is invested. Many people some years back thought they were behaving in the most conservative +manner by purchasing medium or long-term municipal or government bonds. This policy has produced +substantial market depreciation in many cases, and most certainly has failed to maintain or increase real buying +power. + +Conscious, perhaps overly conscious, of inflation, many people now feel that they are behaving in a +conservative manner by buying blue chip securities almost regardless of price-earnings ratios, dividend yields, +etc. Without the benefit of hindsight as ill the bond example, I feel this course of action is fraught with danger. +There is nothing at all conservative, in my opinion, about speculating as to just how high a multiplier a greedy +and capricious public will put on earnings. + +You will not be right simply because a large number of people momentarily agree with you. You will not be +right simply because important people agree with you. In many quarters the simultaneous occurrence of the two +above factors is enough to make a course of action meet the test of conservatism. + +You will be right, over the course of many transactions, if your hypotheses are correct, your facts are correct, +and your reasoning is correct. True conservatism is only possible through knowledge and reason. + +I might add that in no way does the fact that our portfolio is not conventional prove that we are more +conservative or less conservative than standard methods of investing. This can only be determined by examining +the methods or examining the results. + +I feel the most objective test as to just how conservative our manner of investing is arises through evaluation of +performance in down markets. Preferably these should involve a substantial decline in the Dow. Our +performance in the rather mild declines of 1957 and 1960 would confirm my hypothesis that we invest in an +extremely conservative manner. I would welcome any partner’s suggesting objective tests as to conservatism to +see how we stack up. We have never suffered a realized loss of more than 0.5% of 1% of total net assets, and +our ratio of total dollars of realized gains to total realized losses is something like 100 to 1. Of course; this +reflects the fact that on balance we have been operating in an up market. However, there have been many +opportunities for loss transactions even in markets such as these (you may have found out about a few of these +yourselves) so I think the above facts have some significance. + +The Question of Size + +Aside from the question as to what happens upon my death (which with a metaphysical twist, is a subject of +keen interest to me), I am probably asked most often: "What affect is the rapid growth of partnership funds +going to have upon performance?” + +Larger funds tug in two directions. From the standpoint of "passive" investments, where we do not attempt by +the size of our investment to influence corporate policies, larger sums hurt results. For the mutual fund or trust +department investing in securities with very broad markets, the effect of large sums should be to penalize results +only very slightly. Buying 10,000 shares of General Motors is only slightly more costly (on the basis of +mathematical expectancy) than buying 1,000 or 100 shares. + +In some of the securities in which we deal (but not all by any means) buying 10,000 shares is much more +difficult than buying 100 and is sometimes impossible. Therefore, for a portion of our portfolio, larger sums are +definitely disadvantageous. For a larger portion of the portfolio, I would say increased sums are only slightly +disadvantageous. This category includes most of our work-outs and some generals. + +However, in the case of control situations increased funds are a definite advantage. A "Sanborn Map" cannot be +accomplished without the wherewithal. My definite belief is that the opportunities increase in this field as the +funds increase. This is due to the sharp fall-off in competition as the ante mounts plus the important positive +correlation that exists between increased size of company and lack of concentrated ownership of that company's +stock. + +Which is more important -- the decreasing prospects of profitability in passive investments or the increasing +prospects in control investments? I can't give a definite answer to this since to a great extent it depends on the +type of market in which we are operating. My present opinion is that there is no reason to think these should not +be offsetting factors; if my opinion should change, you will be told. I can say, most assuredly, that our results in +1960 and 1961 would not have been better if we had been operating with the much smaller sums of 1956 and +1957. + +And a Prediction + +Regular readers (I may be flattering myself) will feel I have left the tracks when I start talking about predictions. +This is one thing from which I have always shied away and I still do in the normal sense. + +I am certainly not going to predict what general business or the stock market are going to do in the next year or +two since I don't have the faintest idea. + +I think you can be quite sure that over the next ten years there are going to be a few years when the general +market is plus 20% or 25%, a few when it is minus on the same order, and a majority when it is in between. I +haven't any notion as to the sequence in which these will occur, nor do I think it is of any great importance for +the long-term investor. + +Over any long period of years, I think it likely that the Dow will probably produce something like 5% to 7% per +year compounded from a combination of dividends and market value gain. Despite the experience of recent +years, anyone expecting substantially better than that from the general market probably faces disappointment. + +Our job is to pile up yearly advantages over the performance of the Dow without worrying too much about +whether the absolute results in a given year are a plus or a minus. I would consider a year in which we were +down 15% and the Dow declined 25% to be much superior to a year when both the partnership and the Dow +advanced 20%. I have stressed this point in talking with partners and have watched them nod their heads with +varying degrees of enthusiasm. It is most important to me that you fully understand my reasoning in this regard +and agree with me not only in your cerebral regions, but also down in the pit of your stomach. + +For the reasons outlined in my method of operation, our best years relative to the Dow are likely to be in +declining or static markets. Therefore, the advantage we seek will probably come in sharply varying amounts. +There are bound to be years when we are surpassed by the Dow, but if over a long period we can average ten +percentage points per year better than it, I will feel the results have been satisfactory. + +Specifically, if the market should be down 35% or 40% in a year (and I feel this has a high probability of +occurring one year in the next ten--no one knows which one), we should be down only 15% or 20%. If it is more +or less unchanged during the year, we would hope to be up about ten percentage points. If it is up 20% or more, +we would struggle to be up as much. The consequence of performance such as this over a period of years would +mean that if the Dow produces a 5% to 7% per year overall gain compounded, I would hope our results might be +15% to 17% per year. + +The above expectations may sound somewhat rash, and there is no question but that they may appear very much +so when viewed from the vantage point of 1965 or 1970. It may turn out that I am completely wrong. However, +I feel the partners are certainly entitled to know what I am thinking in this regard even though the nature of the +business is such as to introduce a high probability of error in such expectations. In anyone year, the variations +may be quite substantial. This happened in 1961, but fortunately the variation was on the pleasant side. They +won't all be! + +Miscellaneous + +We are now installed in an office at 810 Kiewit Plaza with a first-class secretary, Beth Henley, and an associate +with considerable experience in my type of securities, Bill Scott. My father is sharing office space with us (he +also shares the expenses) and doing a brokerage business in securities. None of our brokerage is done through +him so we have no "vicuna coat" situation. +Overall, I expect our overhead, excluding interest on borrowings and Nebraska Intangibles Tax, to run less than +0.5 of 1% of net assets. We should get our money's worth from this expenditure, and you are most cordially +invited to drop in and see how the money is being spent. + +With over 90 partners and probably 40 or so securities, you can understand that it is quite a welcome relief to +me to shake loose from some of the details. + +We presently have partners residing in locations from California to Vermont, and net assets at the beginning of +1962 amounted to $ 7,178,500.00. Susie and I have an interest in the partnership amounting to $1,025,000.00, +and other relatives of mine have a combined interest totaling $782,600.00. The minimum for new partners last +year was $25,000, but I am giving some thought to increasing it this year. + +Peat, Marwick, Mitchell & Company did an excellent job of expediting the audit, providing tax figures much +earlier than in the past. They assure me this performance can be continued. + +Let me hear from you regarding questions you may have on any aspects of this letter, your audit, status of your +partnership interest, etc. that may puzzle you. + +Cordially Warren E. Buffett. + +APPENDIX + +Partnerships Operating Throughout 1961 + +[TABLE] +Partnership & 1/1/61 Capital at Market & Overall Gain in 1961* & Percentage Gain +Buffett-Associates $486,874.27 $225,387.80 46.3% +Buffett-Fund $351,839.29 $159,696.93 45.4% +Dacee $235,480.31 $116,504.47 49.5% +Emdee $140,005.24 $67,387.28 48.1% +Glenoff $78,482.70 $39,693.80 50.5% +Mo-Buff $325,844.71 $149,163.71 45.8% +Underwood $582,256.82 $251,951.26 43.3% +Total $2,200,783.34 $1,009,785.25 45.9% +[/TABLE] + +Partnerships Started in 1961 + +[TABLE] +Partnership & Paid-in & Date Paid-in & Overall Gain in 1961 & Percentage Gain +Ann-Investments 100,100 (1-30-61) 35,367.93 35.3% +Buffett-TD 250,100 1961 70,294.08 28.1% +Buffett-TD-March $200,100 3-8-61 n/a n/a +Buffett-TD-May $50,000 5-31-61 n/a n/a +Buffett-Holland 125,100 (5-17-61) 16,703.76 13.3% +[/TABLE] + +* Gain in net assets at market values plus payments to limited partners during year. diff --git a/bpl/1961b/bpl-1961b.mp3 b/bpl/1961b/bpl-1961b.mp3 new file mode 100644 index 0000000..a07ed02 Binary files /dev/null and b/bpl/1961b/bpl-1961b.mp3 differ diff --git a/bpl/1961b/inputs-bpl-1961b.txt b/bpl/1961b/inputs-bpl-1961b.txt new file mode 100644 index 0000000..60c67e7 --- /dev/null +++ b/bpl/1961b/inputs-bpl-1961b.txt @@ -0,0 +1,245 @@ +file 3-wavs/output-000.wav' +file 3-wavs/output-001.wav' +file 3-wavs/output-002.wav' +file 3-wavs/output-003.wav' +file 3-wavs/output-004.wav' +file 3-wavs/output-005.wav' +file 3-wavs/output-006.wav' +file 3-wavs/output-007.wav' +file 3-wavs/output-008.wav' +file 3-wavs/output-009.wav' +file 3-wavs/output-010.wav' +file 3-wavs/output-011.wav' +file 3-wavs/output-012.wav' +file 3-wavs/output-013.wav' +file 3-wavs/output-014.wav' +file 3-wavs/output-015.wav' +file 3-wavs/output-016.wav' +file 3-wavs/output-017.wav' +file 3-wavs/output-018.wav' +file 3-wavs/output-019.wav' +file 3-wavs/output-020.wav' +file 3-wavs/output-021.wav' +file 3-wavs/output-022.wav' +file 3-wavs/output-023.wav' +file 3-wavs/output-024.wav' +file 3-wavs/output-025.wav' +file 3-wavs/output-026.wav' +file 3-wavs/output-027.wav' +file 3-wavs/output-028.wav' +file 3-wavs/output-029.wav' +file 3-wavs/output-030.wav' +file 3-wavs/output-031.wav' +file 3-wavs/output-032.wav' +file 3-wavs/output-033.wav' +file 3-wavs/output-034.wav' +file 3-wavs/output-035.wav' +file 3-wavs/output-036.wav' +file 3-wavs/output-037.wav' +file 3-wavs/output-038.wav' +file 3-wavs/output-039.wav' +file 3-wavs/output-040.wav' +file 3-wavs/output-041.wav' +file 3-wavs/output-042.wav' +file 3-wavs/output-043.wav' +file 3-wavs/output-044.wav' +file 3-wavs/output-045.wav' +file 3-wavs/output-046.wav' +file 3-wavs/output-047.wav' +file 3-wavs/output-048.wav' +file 3-wavs/output-049.wav' +file 3-wavs/output-050.wav' +file 3-wavs/output-051.wav' +file 3-wavs/output-052.wav' +file 3-wavs/output-053.wav' +file 3-wavs/output-054.wav' +file 3-wavs/output-055.wav' +file 3-wavs/output-056.wav' +file 3-wavs/output-057.wav' +file 3-wavs/output-058.wav' +file 3-wavs/output-059.wav' +file 3-wavs/output-060.wav' +file 3-wavs/output-061.wav' +file 3-wavs/output-062.wav' +file 3-wavs/output-063.wav' +file 3-wavs/output-064.wav' +file 3-wavs/output-065.wav' +file 3-wavs/output-066.wav' +file 3-wavs/output-067.wav' +file 3-wavs/output-068.wav' +file 3-wavs/output-069.wav' +file 3-wavs/output-070.wav' +file 3-wavs/output-071.wav' +file 3-wavs/output-072.wav' +file 3-wavs/output-073.wav' +file 3-wavs/output-074.wav' +file 3-wavs/output-075.wav' +file 3-wavs/output-076.wav' +file 3-wavs/output-077.wav' +file 3-wavs/output-078.wav' +file 3-wavs/output-079.wav' +file 3-wavs/output-080.wav' +file 3-wavs/output-081.wav' +file 3-wavs/output-082.wav' +file 3-wavs/output-083.wav' +file 3-wavs/output-084.wav' +file 3-wavs/output-085.wav' +file 3-wavs/output-086.wav' +file 3-wavs/output-087.wav' +file 3-wavs/output-088.wav' +file 3-wavs/output-089.wav' +file 3-wavs/output-090.wav' +file 3-wavs/output-091.wav' +file 3-wavs/output-092.wav' +file 3-wavs/output-093.wav' +file 3-wavs/output-094.wav' +file 3-wavs/output-095.wav' +file 3-wavs/output-096.wav' +file 3-wavs/output-097.wav' +file 3-wavs/output-098.wav' +file 3-wavs/output-099.wav' +file 3-wavs/output-100.wav' +file 3-wavs/output-101.wav' +file 3-wavs/output-102.wav' +file 3-wavs/output-103.wav' +file 3-wavs/output-104.wav' +file 3-wavs/output-105.wav' +file 3-wavs/output-106.wav' +file 3-wavs/output-107.wav' +file 3-wavs/output-108.wav' +file 3-wavs/output-109.wav' +file 3-wavs/output-110.wav' +file 3-wavs/output-111.wav' +file 3-wavs/output-112.wav' +file 3-wavs/output-113.wav' +file 3-wavs/output-114.wav' +file 3-wavs/output-115.wav' +file 3-wavs/output-116.wav' +file 3-wavs/output-117.wav' +file 3-wavs/output-118.wav' +file 3-wavs/output-119.wav' +file 3-wavs/output-120.wav' +file 3-wavs/output-121.wav' +file 3-wavs/output-122.wav' +file 3-wavs/output-123.wav' +file 3-wavs/output-124.wav' +file 3-wavs/output-125.wav' +file 3-wavs/output-126.wav' +file 3-wavs/output-127.wav' +file 3-wavs/output-128.wav' +file 3-wavs/output-129.wav' +file 3-wavs/output-130.wav' +file 3-wavs/output-131.wav' +file 3-wavs/output-132.wav' +file 3-wavs/output-133.wav' +file 3-wavs/output-134.wav' +file 3-wavs/output-135.wav' +file 3-wavs/output-136.wav' +file 3-wavs/output-137.wav' +file 3-wavs/output-138.wav' +file 3-wavs/output-139.wav' +file 3-wavs/output-140.wav' +file 3-wavs/output-141.wav' +file 3-wavs/output-142.wav' +file 3-wavs/output-143.wav' +file 3-wavs/output-144.wav' +file 3-wavs/output-145.wav' +file 3-wavs/output-146.wav' +file 3-wavs/output-147.wav' +file 3-wavs/output-148.wav' +file 3-wavs/output-149.wav' +file 3-wavs/output-150.wav' +file 3-wavs/output-151.wav' +file 3-wavs/output-152.wav' +file 3-wavs/output-153.wav' +file 3-wavs/output-154.wav' +file 3-wavs/output-155.wav' +file 3-wavs/output-156.wav' +file 3-wavs/output-157.wav' +file 3-wavs/output-158.wav' +file 3-wavs/output-159.wav' +file 3-wavs/output-160.wav' +file 3-wavs/output-161.wav' +file 3-wavs/output-162.wav' +file 3-wavs/output-163.wav' +file 3-wavs/output-164.wav' +file 3-wavs/output-165.wav' +file 3-wavs/output-166.wav' +file 3-wavs/output-167.wav' +file 3-wavs/output-168.wav' +file 3-wavs/output-169.wav' +file 3-wavs/output-170.wav' +file 3-wavs/output-171.wav' +file 3-wavs/output-172.wav' +file 3-wavs/output-173.wav' +file 3-wavs/output-174.wav' +file 3-wavs/output-175.wav' +file 3-wavs/output-176.wav' +file 3-wavs/output-177.wav' +file 3-wavs/output-178.wav' +file 3-wavs/output-179.wav' +file 3-wavs/output-180.wav' +file 3-wavs/output-181.wav' +file 3-wavs/output-182.wav' +file 3-wavs/output-183.wav' +file 3-wavs/output-184.wav' +file 3-wavs/output-185.wav' +file 3-wavs/output-186.wav' +file 3-wavs/output-187.wav' +file 3-wavs/output-188.wav' +file 3-wavs/output-189.wav' +file 3-wavs/output-190.wav' +file 3-wavs/output-191.wav' +file 3-wavs/output-192.wav' +file 3-wavs/output-193.wav' +file 3-wavs/output-194.wav' +file 3-wavs/output-195.wav' +file 3-wavs/output-196.wav' +file 3-wavs/output-197.wav' +file 3-wavs/output-198.wav' +file 3-wavs/output-199.wav' +file 3-wavs/output-200.wav' +file 3-wavs/output-201.wav' +file 3-wavs/output-202.wav' +file 3-wavs/output-203.wav' +file 3-wavs/output-204.wav' +file 3-wavs/output-205.wav' +file 3-wavs/output-206.wav' +file 3-wavs/output-207.wav' +file 3-wavs/output-208.wav' +file 3-wavs/output-209.wav' +file 3-wavs/output-210.wav' +file 3-wavs/output-211.wav' +file 3-wavs/output-212.wav' +file 3-wavs/output-213.wav' +file 3-wavs/output-214.wav' +file 3-wavs/output-215.wav' +file 3-wavs/output-216.wav' +file 3-wavs/output-217.wav' +file 3-wavs/output-218.wav' +file 3-wavs/output-219.wav' +file 3-wavs/output-220.wav' +file 3-wavs/output-221.wav' +file 3-wavs/output-222.wav' +file 3-wavs/output-223.wav' +file 3-wavs/output-224.wav' +file 3-wavs/output-225.wav' +file 3-wavs/output-226.wav' +file 3-wavs/output-227.wav' +file 3-wavs/output-228.wav' +file 3-wavs/output-229.wav' +file 3-wavs/output-230.wav' +file 3-wavs/output-231.wav' +file 3-wavs/output-232.wav' +file 3-wavs/output-233.wav' +file 3-wavs/output-234.wav' +file 3-wavs/output-235.wav' +file 3-wavs/output-236.wav' +file 3-wavs/output-237.wav' +file 3-wavs/output-238.wav' +file 3-wavs/output-239.wav' +file 3-wavs/output-240.wav' +file 3-wavs/output-241.wav' +file 3-wavs/output-242.wav' +file 3-wavs/output-243.wav' +file 3-wavs/output-244.wav' diff --git a/process.sh b/process.sh index 8029140..d42ceaf 100755 --- a/process.sh +++ b/process.sh @@ -4,9 +4,24 @@ series=$1 year=$2 real=$3 +check_and_exit() { + # Check the exit code + if [ $? -ne 0 ]; then + echo "Error: Command failed" + exit 1 # Terminate the script with a non-zero exit code + fi +} + python3 speak.py $series $year $real +check_and_exit() + rm -f $series/$year/3-wavs/$series-$year.wav +rm -f $series/$year/$series-$year.wav python3 ffmpeg_inputs.py $series/$year "$series-$year" +check_and_exit() + # ffmpeg -f concat -safe 0 -i $series/$year/inputs-$series-$year.txt -c copy $series/$year/$series-$year.wav ffmpeg -i $series/$year/$series-$year.wav $series/$year/$series-$year.mp3 +check_and_exit() + rm -f $series/$year/$series-$year.wav diff --git a/speak.py b/speak.py index 97f3b58..1a45d95 100644 --- a/speak.py +++ b/speak.py @@ -50,7 +50,7 @@ with open(fn) as f: elif (table_flag): if (not table_header_flag): table_header_flag = True - table_headers = lines[i].strip().split(" & ") + table_headers = list(map(lambda x: x.replace(".", ""), lines[i].strip().split(" & "))) lines[i] = "" print(table_headers) elif (lines[i].strip() == "[/TABLE]"): @@ -63,7 +63,8 @@ with open(fn) as f: if (len(table_row) != len(table_headers)): print((f"Line {i}: Malformed table, table body row had {len(table_row)} fields, " - "but table header row had {len(table_headers)} fields.")) + f"but table header row had {len(table_headers)} fields.")) + exit(1) processed_row = [ f"{header} {value}"