Solved

Stand alone number sequence generator?

Posted on 2009-06-27
8
350 Views
Last Modified: 2013-11-13
Does anyone know where I may find a small stand alone application that will return the next sequential number when the programme is executed.
I can acieve this with an Excel macro, but it takes too long to keep opening Excel just for a number.
Ideally the application would copy the number to the clipboard.

This is because my colleagues who use a variety of software need a unique similarly formatted number when indexing their documents. A central file would allow them to create a unique sequential refernce.
Des
0
Comment
Question by:spar-kle
  • 5
  • 3
8 Comments
 
LVL 8

Accepted Solution

by:
JIEXA earned 500 total points
Comment Utility
I suppose, it's on Windows. If so, create a msg.bat file with the following contents, and run it each time you need new number.
The last number resides in msg.dat file.
@echo off

SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION

set f=msg.dat

if not exist %f% echo 0 > %f%

for /f %%i in (%f%) do set /a v=1+%%i & echo !v! > %f%

type %f%

pause

Open in new window

0
 

Author Comment

by:spar-kle
Comment Utility
Excellent this is exactly the kind of thing I was after, thank you
2 things...
1.Instead of displaying would it be possible to copy the number directly to the clipboard?
2.Is it also possible to prefix the number?

Thanks
Des
0
 
LVL 8

Assisted Solution

by:JIEXA
JIEXA earned 500 total points
Comment Utility
1. http://www.petri.co.il/software/clip.zip  (for clip.exe)
2.
replace:

  type %f%

with:

  for /f %%i in (%f%) do set v=my prefix %%i my postfix & echo !v!

or with:

  for /f %%i in (%f%) do set v=my prefix %%i my postfix & echo !v! | clip.exe

Open in new window

0
 

Author Comment

by:spar-kle
Comment Utility
That's great, is it possible to suppress the command window?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:spar-kle
Comment Utility
..alternatively to automatically close the window
0
 
LVL 8

Assisted Solution

by:JIEXA
JIEXA earned 500 total points
Comment Utility
Remove the last "pause" command. The window will open and close.

I've tried to open it out of the desktop (Properties / Layout / Windows position), but it does not work for out-of-boundary.
0
 

Author Comment

by:spar-kle
Comment Utility
Thanks Jiexa for all your help
Works perfectly
0
 

Author Closing Comment

by:spar-kle
Comment Utility
Excellent.
Thanks for all your help
Des
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

One of the biggest challenges facing freelancers is balancing multiple projects and deadlines. Organizational skills and time management are key to keeping up with projects and staying on track. Luckily, we’ve curated seven tools to help you focus o…
With the shift in today’s hiring climate (http://blog.experts-exchange.com/ee-blog/5-tips-on-succeeding-in-the-new-gig-economy/?cid=Blog_031816), many companies are choosing to hire freelancers to get projects completed efficiently and inexpensively…
In this first video of the three-part Xpdf series, we introduce and describe Xpdf, a library containing nine command line utilities that perform various functions on PDF files. We show where the library is located and how to download it, discuss its…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now