Thursday, December 22, 2005

AWK Tricks

I think my favorite go-to tool for Unix scripting work is "awk". After all, how often do you want to split a line of text into columns and then do something based on those columns? Pretty darned often.

Here's a trick I use frequently. You've just created a CSV or otherly delimited file, and you want to validate that there's no extraneous characters in there to break your parsing:

awk -F, '{print NF}' file.csv | sort | uniq -c

if all of your fields have the same number of columns (as they likely should), then you'll just see something like

17 1500

and you know you're all set. But if you see:

17 1498
18 2

you know you've got a problem. How to find it? Easily:

awk -F, '{if (NF!=17) print $0;}' file.csv

Done. Then you can go back in and edit those rows to fix them, if you like. Or if you're in a situation where you can just chuck them out, do the opposite:

awk -F, '{if (NF==17) print $0;}' file.csv > cleanfile.csv

And there you go, cleanfile.csv contains only the rows with the proper number of columns.


Technorati Tags: , ,

Monday, December 12, 2005

If you send them away, they will come back.

I just love this post of Dave Winer's about how to many money on the Internet. In short, the best thing you can do for your visitors is send them away. What does Google do? Sends people away from Google, more efficiently than anybody else. How about Yahoo? What did adding RSS support do for Yahoo? Drastically increased their share of the online news market. Why go to CNN, MSNBC, etc... when you can go to Yahoo and then Yahoo will send you to those places? Who are the most popular blogs? Those that link the most. Even del.icio.us basically puts a little value add on top of what is just a link to somebody else.


I think the underlying lesson is in knowing your strengths, and not fearing competition that is not really there. Yahoo is not a source of news, after all. Nor is Google a source of answers. Both are merely pointers. That is their value. So in order to be the most valuable pointer to things, you have to be willing to point to everything in an unbiased manner. If you pick and choose what you point to, or how you provide your results, then you'll lose value because you're basically saying that you don't trust the customer to come back to you. You're trying to force them into something. They'll spot it in a heartbeat, and you've already lost them.

The new business model appears to be "Look, here's the value I offer. I realize that other sites are valuable to you in a different way. They are not my competitors, I am not worried if you go over there. In fact, I encourage you to do so. Come back when you need me." Certainly you want to add value on top and not just be a list of links -- those have been around since the dawn of the net. Anybody and everybody can do that. You still need differentiators. You need a reason for your customers to pick you over somebody else that does exactly what you do. Maybe if you're a blogger it is in your personal writeup style. Or maybe the way you pick and choose your links for quality. In the case of something like a Google, it's the efficiency and relevancy with which they provide your results. And delicious' value lies in the wisdom of crowds.

I can only daydream about getting myself into a position where I can make money like this. But it's fun to think about. :)

Technorati Tags: , , , ,

Thursday, December 08, 2005

Why Podcast Alley ruins podcasts

Please, save me from podcasts that every month get on the "Hey, go vote for us at Podcast Alley" bandwagon. Every time I hear this, one of a few things is going to happen:

  • I'm going to unsubscribe.

  • I'm going to hit Next and be done with that episode.

  • I'm going to fast forward past it.


You'll notice I didn't say "I'll go vote for you." Why? Because not only is there no value in it for me (I already subscribe!), there's negative value -- because whether I vote for you or not I have to listen to you waste show time with this nonsense. If I like your show, I will talk to my friends about it, I will talk about it on my blogs, and in general I will promote it the best I can. But I will not vote for you on podcast alley, or any other directory. Never have, don't plan on starting.

Why is it important to vote? What do podcasters win? There are no prizes - they win traffic. The higher up you are, the better the traffic you get. Fair enough assessment? My point is that we should be coming up with more creative ways to drive up traffic. I think it's funny that on the one hand, podcasts aren't competitive with each other - after all, they play each other's promos all the time -- but yet they all whore for votes, when we all know for you to be on the top ten someplace means that someone else is not. So you are competing with your brethren using the "vote for me" approach. There's only room at the top for a few.

Here's what I want. I want a feed that periodically tells me about podcasts I don't already know about. Maybe they are brand new and worth a listen, or maybe they've been around since the beginning and I've just never heard of them. For some I will be able to tell if I want it or not just by a description. For some, I'll need to download a sample. I don't plan on voting for anybody that I find this way. I don't mind reviewing them, and saying why I like or don't like them. I'll even go so far as to give a Tivo-style thumbs up or down for them so that my rotating sampler knows which ones it has already given me. But I will not vote for you. Especially not every month.

You want traffic, learn to promote your show in new ways. Right now it seems like every podcast under the sun only has two moves -- whore for votes, or send feedback to Adam Curry pretending to have something interesting to say but really just to get your name out there. Take some public relations lessons. Go hang out on some freelance writers groups, because they all have the same issues. How do you guerilla market yourself? Call up a local radio station and see if you can get an interview spot. Podcasting is the next big thing, everybody knows it, and if you call around you're going to find people who want to talk to you. They don't just want to talk to Dawn and Drew. Especially if you've got something of value to say.

Technorati Tags: ,