You're viewing a comment by Paul and its responses.

Paul Permalink
July 29, 2009, 17:16

1. Create a string of a specific length (generate a string of x’s of length 513).

You don't want the loop, and you don't want the recursion much either.

Two awk standard functions do this FAST.
First make a blank string of the required length.
Then stuff it with the character(s)s you want.

You can call it like x = rep( "x", 513);
Or even like x = rep( "Money ", 20);

function rep (str, num, result) {
result = sprintf ("%" num "s", "");
gsub (/./, str, result);
return (result);
}

Reply To This Comment

(why do I need your e-mail?)

(Your twitter name, if you have one. (I'm @pkrumins, btw.))

Type the word "cloud": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.