digivore Posted June 15, 2009 Share Posted June 15, 2009 Looking for a command or script to generate sequential numbers and save them to a text file. 10 digit long numbers (eg. phone number with area code), I would like to specify the starting number, and the end(or at least the amount of numbers). Could do this in Linux or windows. Anyone have any ideas? Thanks Quote Link to comment Share on other sites More sharing options...
digininja Posted June 15, 2009 Share Posted June 15, 2009 Here you go, just modify the start and end values for the loop # php > your_filename <? for ($i=1000000000;$i<1000000009;$i++) { print $i."\n"; } ?> <ctrl>-d # cat your_filename 1000000000 1000000001 1000000002 1000000003 1000000004 1000000005 1000000006 1000000007 1000000008 Quote Link to comment Share on other sites More sharing options...
digivore Posted June 16, 2009 Author Share Posted June 16, 2009 Works like a charm!! thanks very much Digininja! and if anyone is interested, merging 2 files in linux: cat file1 file2 > mergedfile And to sort it and have duplicate lines removed cat file1 file2 | sort | uniq > mergedfile Quote Link to comment Share on other sites More sharing options...
digininja Posted June 16, 2009 Share Posted June 16, 2009 Just to tidy things... sort -u == |sort|uniq so you get cat file1 file2|sort -u > mergedfile Which then becomes sort -u file1 file2 > mergedfile Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.