English Amiga Board


Go Back   English Amiga Board > Support > support.Apps

 
 
Thread Tools
Old 23 April 2012, 10:07   #1
source
Zone Friend
 
Join Date: Jul 2005
Location: Toronto, Canada
Posts: 715
Auto Line numbering

I was wondering if there was a way to create a column that just numbers the lines. I have a list of names and addresses, all separated by commas so I can import into a mail merge. I was wondering if there was any software out there that would create another column and add the line number to it ie.

I Have

Lastname,Firstname,StreetAddress,Town
Lastname,Firstname,StreetAddress,Town
Lastname,Firstname,StreetAddress,Town

I want

1,Lastname,Firstname,StreetAddress,Town
2,Lastname,Firstname,StreetAddress,Town
3,Lastname,Firstname,StreetAddress,Town

Any help would be greatly appreciated.
Thanks in advance.
source is offline  
Old 23 April 2012, 12:25   #2
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,117
Ther might be a tool but if you don`t care about speed try this ARexx script:
Code:
/* Auto line numbering.
   Usage: rx LineNr.rexx <source> <target>
   E.g.: rx LineNr.rexx file.txt fileNL.txt
*/

PARSE ARG src tar .

IF ~OPEN('in', src, 'READ') THEN DO
 SAY "Can't open" src "for reading."
 CALL CLOSE('in')
 EXIT
END

IF ~OPEN('out', tar, 'WRITE') THEN DO
 SAY "Can't open" tar "for writing."
 CALL CLOSE('out')
 EXIT
END

i = 1
stream = READLN('in')
DO UNTIL EOF('in')
 CALL WRITELN('out', i || ';' || stream)
 stream = READLN('in')
 i = i + 1
END
daxb is offline  
Old 24 April 2012, 02:31   #3
source
Zone Friend
 
Join Date: Jul 2005
Location: Toronto, Canada
Posts: 715
Thanks it worked great. I saved a lot of number typing.
source is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto auto fire? john4p request.UAE Wishlist 6 22 January 2010 08:50
Auto Link Gordon HOL suggestions and feedback 17 06 May 2009 23:13
auto refresh turrican3 request.UAE Wishlist 0 13 May 2007 13:30
Auto path change? Djay request.UAE Wishlist 7 23 April 2006 00:29
Auto-fire Tim Janssen support.WinUAE 2 02 May 2002 08:42

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:11.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.
Page generated in 0.07271 seconds with 15 queries