i have many text files containing text given below.
\\ Paper: hep-th/9201003
From: DIJKGRAAF%IASSNS.BITNET@pucc.PRINCETON.EDU
Date: Thu, 2 Jan 92 14:06 EST (54kb)
Title: Intersection Theory, Integrable Hierarchies and Topological Field Theory
Authors: Robbert Dijkgraaf
Comments: 73 pages, most figures are not included. Lectures given at the Cargese Summer School on `New Symmetry Principles in Quantum Field Theory,' July 16-27, 1991.
\\ In these lecture notes we review the various relations between intersection theory on the moduli space of Riemann surfaces, integrable hierarchies of KdV type, matrix models, and topological quantum field theories. We explain in particular why matrix integrals of the type considered by Kontsevich naturally appear as tau-functions associated to minimal models. Our starting point is the extremely simple form of the string equation for the topological (p,1) models, where the so-called Baker-Akhiezer function is given by a (generalized) Airy function. \\
i have 10 folders in range 1992 to 2003. every folder contain thousands of files. every files have a structure that is given above. i want to extract the last portion of every file and save in new file. this portion is abstract of the paper. every file have different abstract. i have write the following code for my problem but unable to get the target.
for(j in 1992:1992)
{
dir.create(paste("C:\\Users\\Abdul Samad Alvi\\Desktop\\mydata\\",j, sep = ""))
setwd(paste("C:\\Users\\Abdul Samad Alvi\\Desktop\\dataset\\",j, sep = ""))
listoffile=list.files()
for(i in 1:length(listoffile))
{
setwd(paste("C:\\Users\\Abdul Samad Alvi\\Desktop\\dataset\\",j, sep = ""))
filetext=readLines(listoffile[i])
newtext=unlist(strsplit(filetext,'\\\\'))[3]
setwd(paste("C:\\Users\\Abdul Samad Alvi\\Desktop\\mydata\\",j, sep = ""))
write.table(newtext,file = listoffile[i],sep = "")
}
}