I have a Perl script that will assign absolute line numbers, and it can be tweaked not to assign line numbers to ascii lines beginning with <milestone, <lg, <fw, <marginalia, etc. One can supply the </l> by a search/replace operation, or you could use another Perl script to assign </l>. I'll be glad to supply these scripts if something more useful is not generally available. Best, Dug
At 06:14 PM 11/14/2006, you wrote:
No answer, I'm afraid, but let me ask that we share the answer to this with the list (and the wiki). This is exactly the type of thing we can use!
-dan
On Tue, 2006-11-14 at 16:07 -0700, Murray McGillivray wrote:
Folks, I have a number of text files of poetry that I'd like to add line numbers to for concordancing, starting the numbering at 1 and continuing to the last text line, with the line numbers ending up as part of the resulting text file, each number on the relevant line before the text of that line of verse begins.
I've done this before a few times a while ago, but danged if I can remember what I used. I know I didn't write anything to do it, though I assume it's pretty easy to do so. I think it was in a text editor or word processor, but looking at vi and emacs it looks like I can only get the line numbers to display with the file, not to be added to the file, and that's true of some Windows ones as well and of Word, unless there are tricks.
The UNIX/Linux "nl" utility does basically what I want (if I pipe the output to a file, I get my text file back but with a line number and a tab added to the beginning of each line), and I can deal with the output but I remember (possibly from one of those technicolor dreams--you'll let me know!) a more interactive, less command-liney, way of doing this that would make this stage easier.
Thanks for any help.
Murray McGillivray
Digital Medievalist Project Homepage: http://www.digitalmedievalist.org Journal (Spring 2005-): http://www.digitalmedievalist.org/journal.cfm RSS (announcements) server: http://www.digitalmedievalist.org/rss/rss2.cfm Wiki: http://sql.uleth.ca/dmorgwiki/index.php Change membership options: http://listserv.uleth.ca/mailman/listinfo/dm-l Submit RSS announcement: http://www.digitalmedievalist.org/newitem.cfm Contact editorial Board: digitalmedievalist@uleth.ca dm-l mailing list dm-l@uleth.ca http://listserv.uleth.ca/mailman/listinfo/dm-l
-- Daniel Paul O'Donnell, PhD Department Chair and Associate Professor of English Director, Digital Medievalist Project http://www.digitalmedievalist.org/ Chair, Text Encoding Initiative http://www.tei-c.org/
Department of English University of Lethbridge Lethbridge AB T1K 3M4 Vox +1 403 329-2377 Fax +1 403 382-7191 Email: daniel.odonnell@uleth.ca WWW: http://people.uleth.ca/~daniel.odonnell/
Digital Medievalist Project Homepage: http://www.digitalmedievalist.org Journal (Spring 2005-): http://www.digitalmedievalist.org/journal.cfm RSS (announcements) server: http://www.digitalmedievalist.org/rss/rss2.cfm Wiki: http://sql.uleth.ca/dmorgwiki/index.php Change membership options: http://listserv.uleth.ca/mailman/listinfo/dm-l Submit RSS announcement: http://www.digitalmedievalist.org/newitem.cfm Contact editorial Board: digitalmedievalist@uleth.ca dm-l mailing list dm-l@uleth.ca http://listserv.uleth.ca/mailman/listinfo/dm-l