Just tested the speed of both progs;-
To generate 50,000 unique 20 digit codes (on my not-so-fast old pc)
My posted code took 72.163 seconds elapsed
Mikrom's posted code took 75.484 seconds elapsed
Just goes to show that however you write your code, Rexx does a good job!
But I did manage to...
OK so it'll be quicker still if we remove the redundant calls to Length()
Phil
/* REXX */
dgts='1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
maxlines=10 ; numchars=20
used.=0 ; lines=0 ; rmax=length(dgts)-1 ; ixlen=length(maxlines)
do while lines<maxlines
code=''
do...
Couldn't resist a post here, this might be faster, and also makes it easier to alter the alowable characters, so it's easy to remove the letter 'o' and number 0 if these characters are too similar, just remove them from the string. Or add specials if you want!
Phil
/* REXX */...
Good point Steve, not all CSV's are created equal!
So far, I've only had to process CSV's that came from various versions of Excel, so i've been insulated from those that don't use the psudo standard that exists in Excel.
When I do get my hands on another 'Non-Excel' setup I'll see if it can...
Hi Stan,
This wasn't exactly a request for help, the code I posted actually solved my problem. I thought it might help others trying to process .csv files with "unhelpfull" content.
If you put a heap of quotes,commas, and things like "","",',' into cells in Excel, then save it as a .csv, then...
If youre using the 64 bit version of Regina then the packages won't load, the RXXMATH Math Functions by John Brock, that are bundled with the regmath100 files, work fine and allow for increased precision.
thread277-1601818
Further to the previous thread, I needed to parse several .csv files with a variable number of columns, where the columns may be quoted with embedded commas and or imbedded quotes, typical of user files from Excel.
I ended up with this, I’m sure it could be improved but it...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.