DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: DONE: Line-Numbered textfile  (Read 11,419 times)

RedPillow

  • Pillows.
  • Member
  • Joined in 2008
  • **
  • Posts: 141
DONE: Line-Numbered textfile
« on: March 10, 2010, 04:05 PM »
I have decided to start this little youtube-game bymyself, where I seek for videos from 1 viewers to 100 000 000 viewers.
And for that, I need a checklist from 1 to 100 000 000.

So, i need someone to make me a program, which creates textfile with lines "from" "to" and user can choose where to start and where to quit, and the max number should be 100 000 000.
And if possible + bonus for you, make it so that in every line there is space after number.

edbro

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 426
Re: IDEA: Line-Numbered textfile
« Reply #1 on: March 10, 2010, 04:39 PM »
Can't you do this in Word using Autofill or a macro? I'm not really sure what you are trying to do as I don't know what you mean by "user can choose where to start". Start what?

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Re: IDEA: Line-Numbered textfile
« Reply #2 on: March 10, 2010, 04:56 PM »
This is trivial to write...but you do realise that a text file with 100,000,000 lines will be over 1 gigabyte in size, right?  Trying to manipulate that in most text editors will be an exercise in futility.
« Last Edit: March 10, 2010, 04:58 PM by skwire »

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Re: IDEA: Line-Numbered textfile
« Reply #3 on: March 10, 2010, 05:35 PM »
Here you go (source/binary included):  TextLiner.zip

2010-03-10_113401.png

RedPillow

  • Pillows.
  • Member
  • Joined in 2008
  • **
  • Posts: 141
Re: IDEA: Line-Numbered textfile
« Reply #4 on: March 10, 2010, 06:00 PM »
Here you go (source/binary included):  TextLiner.zip
(see attachment in previous post)

Exactly what I needed!
This is simple and powerful, thanks a ton!

Also, it makes my processor to roll!  ;D

P.S You`re really good @ making nice and clean interfaces.


EDIT: Total filesize for 1 to 100 000 000 file is: 1 063 369.

AND

My notepad started complaining that its too big for her - I have to use something else :P

ALSO

Wordpad opens it nicely in aprox. 1 minute.
« Last Edit: March 10, 2010, 06:11 PM by RedPillow »

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • Coding Snacks
Re: IDEA: Line-Numbered textfile
« Reply #5 on: March 10, 2010, 09:13 PM »
You may be able to find a text editor that only opens a "window" into the file, instead of opening the entire file in memory.  I don't know of any off-hand.  But back in the old Dos days you only had 640KB so you couldn't just load a MB file in ram.  The editor would seek through the file on disk and load a portion of it.

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Re: IDEA: Line-Numbered textfile
« Reply #6 on: March 11, 2010, 09:48 AM »
Exactly what I needed!

Great to hear.  I'll move this to the finished section.

Original address: https://www.donationcoder.com/forum/index.php?topic=22041.0