Sponsored Content
Top Forums Shell Programming and Scripting Millions of record using shell script Post 302759177 by Chubler_XL on Monday 21st of January 2013 05:08:00 PM
Old 01-21-2013
Reminds me of a program I had to write a while ago that generates random names and addresses (needed to valid towns and postcodes) I also used census data to pick genuine looking names.

The street names are just random english words and can produce some quite funny addresses from time to time:

Code:
1,"MR NK ROGOSKY","5-27 DISTRAUGHT BAYOO BON AMI, TX 75956"
2,"REGINALD & SHERRY COLEMAN","11 NESTORIANS AVENUE NOEL, MO 64854"
3,"D PRUITT","25 CONSTANT ROAD LAREDO, TX 78040"
5,"DR&MR T G PEDE","25 EMBARRASS AVENUE STREATOR, IL 61364"
6,"MICHAEL HUSSAIN","4 NECESSITOUSNESS DRIVE KENNEDYVILLE, MD 21645"
7,"MRS RIKKI BARIAS","23 MERITED STREET HARRIS, MO 64645"
8,"TIMOTHY CLEWIS","4 GRASP CRESCENT CLARKSBURG, MD 20871"
9,"NATHALIE G DUVALL","13 CHARACINS LANE BOLIGEE, AL 35443"
10,"MRS SAL BETTYE BECKHAM","BOX 2965 WILLIAMSON, GA 30292"
11,"D MEHLER","12 CHEMOTAXIS LANE JACKSON, NC 27845"
12,"S. & M LAURO","9/8 CRUCIBLE LANE SLATER, MO 65349"
13,"M. K. CASTRO","29 VASECTOMY LANE MULDROW, OK 74948"
14,"MRS AGATHA PUERTAS","9 EQUILIBRATED STREET SMELTERVILLE, ID 83868"
15,"S D MARLOW","12 STRANGULATED BLVD PHILADELPHIA, PA 19130"
16,"JOSHUA C SELTZEN","18 GAUD ROAD HUBBARD, OH 44425"
17,"MASTER H GOETTER","3-12 CYSTOTOMY ROAD MARATHON, TX 79842"
18,"MS & PROF J COLLEY","1/18 OVERMASTERS CLUB PIERPONT, SD 57468"
19,"JUNE GRANDON","30 GUSTY BLUFF FORT KENT, ME 04743"
20,"MASTER L SMITH","24 SECULAR BRANCH POWDERLY, TX 75473"
21,"MRS & MR CHRISTOPHER R ARABIA","75 EXCRESCENCE LANE HARFORD, PA 18823"
22,"PLONKO WORLDWIDE","16 SOVIETISATION DRIVE SANDERS, KY 41083"
23,"C G MALTAIS","13 IMMITIGABILITY BLVD LAS VEGAS, NV 89102"
24,"P&D MILLER","19 DIRTI BAYOO LAKE PRESTON, SD 57249"
25,"EJ JENKINS","30 MEDITATIONS BLVD DETROIT, OR 97342"
26,"RUBEN BARRETT","30 UNSYMMETRICAL CRESCENT VIRGINIA BEACH, VA 23459"
27,"JENNIFER BLACKSON","6-57 BARREN CSWY SIOUX CITY, IA 51104"
28,"MRS J. M. WASSUM","17 SPLATS DRIVE LYONS, OR 97358"
29,"CHRISTOPHER RYAN & CYNTHIA INGOLD","192 SURVEY CAPE SAINT MARY, MT 59417"
30,"DR. & MR. GEORGE N. CASARELLA","8 SALESMAN CLIFF SHOALS JUNCTION, SC 29638"

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Shell script failing to read large Xml record-urgent critical help

Hi All, I have shell script running on AIX 5.3 box. It has 7 to 8 "sed" commands piped(|) together. It has a an Xml file as its input which has many records internally. There are certain record which which have more than hundered tags.The script is taking a huge amount of time more than 1.5 hrs... (10 Replies)
Discussion started by: aixjadoo
10 Replies

2. Shell Programming and Scripting

Parsing record into multiple records in Shell Script

Hi, I am trying to parse a very long record in a text file into multiple records by checking ADD, DELETE, or MODIFY field value in a shell script. Input # File name xyz.txt ADD|N000|8015662|DELETE|N001|9915662|MODIFY|N999|85678 Output ADD|N000|8015662| DELETE|N001|9915662|... (8 Replies)
Discussion started by: naveed
8 Replies

3. Shell Programming and Scripting

Generating millions of record using shell script

Hi All, My requirement is like this. I want to generate records of 1 million lines. If I say lines it means one line will contain some string or numbers like AA,3,4,45,+223424234,Tets,Ghdj,+33434,345453434,........................ upto length lets say 41. ( 41 comma sepearted aplha numneric... (2 Replies)
Discussion started by: Rahil2k9
2 Replies

4. Shell Programming and Scripting

Shell script for searching a record,copy to a file and then delete it

Hi, I have a requirement in hand: I have a file with millions of records say file 1.I have another file, say file 2 which has 2000 records in it. The requirement is to read file2 , and remove the read record from file 1 and move i to a seperate file, file 3. For eg: Read file 2, get the... (5 Replies)
Discussion started by: kumara2010
5 Replies

5. UNIX for Advanced & Expert Users

How to zip/tar millions of files?

Hi guys, I have an issue processing a large amount of files. I have around 5 million files (some of them are actually directories) in a server. I am unable to find out the exact number of files since it's taking "forever" to finish (See this thread for more on the issue). Anyway, now I... (6 Replies)
Discussion started by: verdepollo
6 Replies

6. Shell Programming and Scripting

Need script to remove millions of tmp files in /html/cache/ directory

Hello, I just saw that on my vps (centOS) my oscommerce with a seo script has created millions of tmp files inside the /html/cache/ directory. I would need to remove all those files (millions), I tried via shell but the vps loads goes to very high and it hangs, is there some way to do a... (7 Replies)
Discussion started by: andymc1
7 Replies

7. Shell Programming and Scripting

Extract record in shell script,so far using awk without success

hello, I require help in the following. There is a report similar to the ones shown here. I need to do couple of things 10/07 12:47 0003210042 R TENN ANVISER0 DELF96A.V1.O.TENRREG 120710 124657 U 00000 DELFOR 1 4331 10/07 12:47 0003210043 S TENN... (2 Replies)
Discussion started by: rakeshv
2 Replies

8. Shell Programming and Scripting

Print record count of a file using shell script

HI, I need to print the record count of a file using shell script. If the record count of a file excluding header and trailer record if greater than zero then print 'Record count of a file is xxxx records'. If the record count is zero print 'zero records' Thanks Mahendra (1 Reply)
Discussion started by: mmeda
1 Replies

9. Shell Programming and Scripting

Shell script for field wise record count for different Files .csv files

Hi, Very good wishes to all! Please help to provide the shell script for generating the record counts in filed wise from the .csv file My question: Source file: Field1 Field2 Field3 abc 12f sLm 1234 hjd 12d Hyd 34 Chn My target file should generate the .csv file with the... (14 Replies)
Discussion started by: Kirands
14 Replies

10. Shell Programming and Scripting

Need code for updating second record to first record in shell scripting

Hi,, I have requirement that i need to get DISTINCT values from a table and if there are two records i need to update it to one record and then need to submit INSERT statements by using the updated value as a parameter. Here is the example follows.. SELECT DISTINCT ID FROM OFFER_GROUP WHERE... (1 Reply)
Discussion started by: Samah
1 Replies
ROAD(7) 						 Miscellaneous Information Manual						   ROAD(7)

NAME
road, gps - road map of the United States SYNOPSIS
games/road [ -g ] [ -s scale ] games/gps DESCRIPTION
Road displays a road map centered around some specified place in the United States. The data comes from the Census Bureau Tiger Database. The map is drawn in three shades of grey. Light grey is used for water features such as rivers, streams and lakes. Dark grey is used for railroads and airports. Black is used for roads. On terminals with ldepth zero, all shades appear black. Without options, the center of the map is the latitude and longitude specified in the file /lib/sky/here. If the -g option is given, the center of the map will be the latitude and longitude specified by continually monitoring the end of the file /tmp/gpslog. This file is written by the GPS satellite receiver program gps. With this option, and with gps running, road becomes a moving map display suitable for cars or planes. Keyboard commands s number sets the scale of the map to number. The number can be prefixed with + or - to increase/decrease the current scale. Scale 6 is about one mile across the screen and scale 10 is about ten miles across. Scales 1 through 10 are drawn with maximum detail showing all roads, trails, rivers, streams and airports. Scales 11 through 14 show highways, rivers, airports and county boundaries. Scales 15 through 20 show interstate highways and state boundaries. /regexp All features labeled by text matching the regular expression are highlighted. p place centers the map at the specified place. Usually the place must have the associated state code, (eg murrayhill,nj) but places like lax and ewr are also known. l latitude longitude centers the map at the specified coordinate. g toggles the -g option described above. q Exit. Mouse button commands Button 1 displays the text of the line nearest the cursor. Normally this is the name of a street or river. Button 2 displays the text of the place nearest the cursor. Normally this is a town. Button 3 centers the display on the cursor position. Gps reads /dev/eia0 assumed connected to a Garmin GPS-55 satellite receiver and writes the current location on the end of the file /tmp/gpslog. It is intended to be used with mobile PC's. FILES
/lib/roads/LLLL/LLLLGGGG.h scale 1-10 database files where LLLL is the latitude multiplied by 5 and GGGG is the longitude multiplied by 5. /lib/roads/LLL/LLLGGG.h scale 11-14 database files where LLL is the latitude multiplied by 1 and GGG is the longitude multiplied by 1. /lib/roads/LL/LLGG.h scale 15-20 database files where LL is the latitude multiplied by 0.2 and GG is the longitude multiplied by 0.2. /lib/roads/place /lib/roads/place.local are the translations between place names and locations. These files must be sorted. /lib/sky/here default starting map center. /tmp/gpslog moving map location. SOURCE
/sys/src/games/road /sys/src/games/gps ROAD(7)
All times are GMT -4. The time now is 12:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy