I thought I’d share my experience with importing the a tab delimited file into an sqlite db as documentation on how to do so is not that easy to find on the web.
In my example I will be importing the US Census ZIP Code Tabulation Area file for 2010. Once you’ve downloaded the file unzip then create the sqlite db and then you’re ready to perform data import. The code block below contains the series of commands which I perform.
cat Gaz_zcta_national.txt | tail -n +2 > Gaz_zcta_national.csv
CREATE TABLE IF NOT EXISTS zcta(geoid text primary key, population integer, housingunitcnt integer, land_area_metric real, water_area_metric real, land_area_eng real, water_area_eng real, lat real, lng real);
.import Gaz_zcta_national.txt zcta
select * from zcta;
Got the following in a forwarded email. Usually don’t share but I found this one very interesting. Enjoy…
Worth a few moments of reading…
That modern “green thing”
A somewhat “older” woman was at a checkout stand in a supermarket The helpful, young cashier suggested that the older woman should bring her own grocery bags, because plastic bags weren’t good for the environment.
The older woman apologized and explained, “We didn’t have this “green thing” back in my earlier days.”
The clerk responded, “That’s our problem today. Your generation did not care enough to save our environment for future generations.”
She was right — our generation didn’t have the green thing in its day.
Back then, we returned milk bottles, soda bottles and beer bottles to the store. The store sent them back to the plant to be washed and sterilized and refilled, so the same bottles could be used hundreds of times. So they really were recycled. But we didn’t have the green thing back in our day.
Stores bagged our groceries in brown paper bags, which we reused for numerous things. Most memorable besides household garbage bags, was the use of brown paper bags as covers for our school books. This was to ensure that public property, (the books provided for our use by the school) was not defaced by our graffiti. Then we were able to personalize our books without vandalizing them. Too bad we didn’t do the green thing back then.
We walked up stairs, because we didn’t have an escalator in every store and office building. We walked to the grocery store and didn’t climb into a 300-horsepower machine every time we had to go two blocks. But she was right. We didn’t have the green thing in our day.
Back then, we washed the baby’s diapers because we didn’t have the throw-away kind. We dried clothes on a line, not in an energy-gobbling 240-volt machine. Wind and solar power really did dry our clothes back in our early days. Kids got hand-me-down clothes from their brothers or sisters, not always brand-new clothing. But that young lady is right; we didn’t have the green thing back in our day.
Back then, we had one TV, or radio, in the house — not a TV in every room. And the TV had a small screen the size of a handkerchief (remember them?), not a screen the size of the state of Montana. In the kitchen, we blended and stirred by hand because we didn’t have electric machines to do everything for us.
When we packaged a fragile item to send in the mail, we used wadded up old newspapers to cushion it, not Styrofoam or plastic bubble wrap. Back then, we didn’t fire up an engine and burn gasoline just to cut the lawn. We used a push mower that ran on human power. We exercised by working, so we didn’t need to go to a health club to run on treadmills that operate on electricity. But she’s right – we didn’t have the green thing back then.
We drank from a fountain when we were thirsty instead of using a cup or a plastic bottle every time we had a drink of water. We refilled writing pens with ink instead of buying a new pen, and we replaced the razor blades in a razor instead of throwing away the whole razor just because the blade got dull. But we didn’t have the green thing back then.
Back then, people took the streetcar or a bus, and kids rode their bikes to school or walked, instead of turning their moms into a 24-hour taxi service. We had one electrical outlet in each room, not an entire bank of sockets to power a dozen appliances. And we didn’t need a computerized gadget to receive a signal beamed from satellites in outer space, in order to find the nearest burger joint.
But isn’t it sad that the current generation laments how wasteful we old folks were, just because we didn’t have the green thing back then?
Please forward this on to another selfish old person who needs a lesson in conservation from smartass young people.
We don’t like being old in the first place, so it doesn’t take much to piss us off.
On CNN’s Piers Morgan Tonight it’s host was put on the spot by his guest Michael Moore to defend the news network’s decision to send it’s news reporters out into the path of Super Storm Sandy to cover the “News”. Moore an Academy Award Winning Filmmaker, spoke specifically about Ali Velshi who stood in the middle of a New Jersey street as flood water rose and Sandy’s winds blew him around, risking his life for the greater good of telling the news. At the same time that was happening a entire neighborhood was being burnt to the ground. Morgan claimed that Ali’s covering of the storm was necessary to keeping people informed and ensure that lives were saved even if it was just one.
To the defense of CNN there was a lot of chaos during Sandy and covering everything act of destruction by the storm was certainly not possible. At the same time however I think something has to be said about the trend of weather reporters – or just reporters as some don’t even know a cumulonimbus from a cirrus cloud – risking life and limb to bring us the news. I would even venture to say that they put more lives at risk than they save. If a guy who gives financial advice as his day job can go out and weather the storm why can’t some other guy. Or if there is news camera just down the street why shouldn’t someone just run down there to get their 15 mins of fame. While Ali was covering the storm several as many as three guys showed up from nowhere dancing in the background. So yeah Piers, one life may be saved bu many more put in danger. How do you rationalize that?
I think you would have those who test the elements. But in this day and ages where we can send a drone half way around the world there is absolute no reason for us to send any out into a storm to cover the news other than ratings.
It appears the cat is out of the bag. According to China Labor Watch Foxconn the Taiwanese electronics manufacturer famous for producing Apple’s iPhone now admits it used minor at some of its factories in China. The company released and apology and threatened to terminate the employment of anyone involved in violation of China’s labor laws and it’s own company policies. This will probably be seen publicly as an attempt to save face as the company is trying to recover from bad press about labor conditions at it’s factories in China.
In my humble opinion apology or no apology, as long as the company keeps pumping out iPhone, iPad or iWhateva it is very unlikely that their business will be affected.
Gizmag writes that ASUS has just unveiled the PadFone2 powered by Google Andriod (Ice Cream Sandwich). In general I have to say I really like the concept of having one primary device and just using an auxiliary device to take advantage of a large screen when the situation calls for it. Such scenarios might include reading a book or watching a video or movie. The problem I have with this device however is that instead of finding a way to utilize two screens at the same time like an extended desktop or something similar they made the device to only work with one screen at a time.