Mike Lewis
Programmer
My previous weekend brain exercise turned turned out to be too easy - although it did generate an interesting discussion. Let me give you something different to think about this time.
You have a text file. The requirement is simply to add line numbers to it.
For example, the file might look like this:
[tt]Alfreds Futterkiste
Antonio Moreno Taquería
Around the Horn
Berglunds snabbköpö
Blauer See & Delikatessen
Blondel père et fils
Bólido Comidas preparadas
Bon app' edited
Bottom-Dollar Markets[/tt]
Your job is to make it look something like this:
[tt]1 Alfreds Futterkiste
2 Antonio Moreno Taquería
3 Around the Horn
4 Berglunds snabbköpö
5 Blauer See & Delikatessen
6 Blondel père et fils
7 Bólido Comidas preparadas
8 Bon app' edited
9 Bottom-Dollar Markets[/tt]
As before, the aim is to do the job with the least amount of code (fewest lines, shortest lines).
If you are one of the first to reply, please wrap your solution in [ignore][/ignore] tags so that others won't see it straight away.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Visual FoxPro articles, tips and downloads
You have a text file. The requirement is simply to add line numbers to it.
For example, the file might look like this:
[tt]Alfreds Futterkiste
Antonio Moreno Taquería
Around the Horn
Berglunds snabbköpö
Blauer See & Delikatessen
Blondel père et fils
Bólido Comidas preparadas
Bon app' edited
Bottom-Dollar Markets[/tt]
Your job is to make it look something like this:
[tt]1 Alfreds Futterkiste
2 Antonio Moreno Taquería
3 Around the Horn
4 Berglunds snabbköpö
5 Blauer See & Delikatessen
6 Blondel père et fils
7 Bólido Comidas preparadas
8 Bon app' edited
9 Bottom-Dollar Markets[/tt]
As before, the aim is to do the job with the least amount of code (fewest lines, shortest lines).
If you are one of the first to reply, please wrap your solution in [ignore][/ignore] tags so that others won't see it straight away.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Visual FoxPro articles, tips and downloads