I have data files that look something like this:

B Schools of Economic Thought and ^MMethodology ^MFIORITO, LUCA,
  New School for Social Research ^M2003. The Years of High Pluralism:  
Three Essays on ^MU.S
. Interwar Economics ^MKEMP, THOMAS A.,
  Colorado State University 2002. ^MProgress and Reform: The Economic  
Thought of John ^MR.
Commons ^MC Mathematical and Quantitative Methods ^MAL-FAKHOURI,  
ZUHAIR NU'MAN,
  Wayne State University 2003. Fractional Integration in Macroeconomic  
^Mand Financial Time
  Series: Evidence, Estimation and ^MApplication ^MANDERSON, AXEL,
  University of Michigan 2002. ^MThree Essays on Learning and  
Experimentation ^MATAKAN, ALP
. E.,
  Columbia University 2003. Essays ^Mon Bargaining, Search and  
Matching ^MAZZAM, ISLAM,
  University of California, Irvine 2003. ^MModel-Selection Uncertainty  
in Autoregressive Mo
dels ^MBACHMEIER, LANCE, J.,
  Texas A&M University 2002. ^MEssays on Forecasting Stationary and  
Nonstationary ^MEconomi
c Time Series ^MBIN, OKMYUNG,
  Oregon State University 2000. Estimation of Implicit Prices in  
Hedonic Price Models: Flex
ible Parametric versus Additive Nonparametric Approach ^MCAMPBELL, SEAN,
  University of Pennsylvania 2002. ^MRegime Switching in Economics  
^MCHEN, M. KEITH,
  Harvard University 2003. Bargaining behind Bars ^MCHO, JIN SEO,
  University of California, San Diego ^M2002. Three Essays on Testing  
Hypotheses with Irreg
ular Conditions ^MCHO, YONG-WOON,

on which I would like to operate on with a file, v.vim  that looks  
something like this:

%s/^M\([A-Z][ A-Z]\)/\r\1/g
%s/^M//g
g/^ /-1join
write tmp
quit

If, interactively, I use

        :source v.vim

where v.vim contains the first 3 lines of the above file,  everything  
seems fine, but when I try
on the command line

        vim -e -s data.txt <v.vim

the result in tmp is a concatenation into one line.  I hope that  
someone can explain what I'm
doing wrong, this is my first attempt to use vim in this way, so  
undoubtedly I'm misinterpreting
something and using the wrong search keywords to track down the problem.

(this is vim VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Nov 11 2008  
17:20:43)
Included patches: 1-22   Compiled by [email protected]


url:    www.econ.uiuc.edu/~roger            Roger Koenker
email    rkoenker  at  uiuc.edu            Department of Economics
vox:     217-333-4558                University of Illinois
fax:       217-244-6678                Champaign, IL 61820




--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to