Perl script to create csv files with a pattern – Generic script.

I was having a really bad day and needed a quick solution to create some csv files. And this I needed to do for multiple data kinds and patterns, so I created this small script to do the job for me…

#Number of rows required in the output.

$rows = 100;

#The config and the output file

open (CF_FILE, \”<Config.test\”);
open (OUT_FILE, \”>test.csv\”);

#—————————————————————————
# No need to change anything below this.
#—————————————————————————

$count = 0 ;

#read a line from config file of the type

#also any line starting with # is treated as comment.

# startingvalue incrementvalue

# so you can have any number of fields here and all of them you would be joined with , to write to the output file.
while (<CF_FILE>)
{
/^#/ && next;
chomp();
@vars = split(/ /);
$arr[$count] = $vars[0];
$arr_inc[$count] = $vars[1];
$count++;
}
for ($i=0; $i < $rows; $i++)
{
$line = join (\”,\”,@arr);
print OUT_FILE \”$line\\n\”;
for ($j=0; $j < $count; $j++)
{
$arr[$j] += $arr_inc[$j];
}
}

\"Reblog

Opens Four Google Frames At Once

\"Google
Image via Wikipedia

Googlegooglegooglegoogle: Opens Four Google Frames At Once Googlegooglegooglegoogle (that is Google times 4!) is a simple website/startpage that puts four Google search windows in one page. It basically displays four frames so that you do not have to leave the page to search simultaneously. This tool is incredibly useful for Google power searchers.
\"\"

Googlegooglegooglegoogle allows you to type a URL and go directly to a website within a frame. There is also a special icon where you can go straight to Wikipedia and an icon to go back to Google. This is very convenient if you hate shifting through browser tabs.

Features:

  • Useful startpage that puts four Google windows in one page
  • Dedicated icons go straight to Wikipedia or back to Google
  • Type a URL to go directly to a website within the frame
  • Allows you to close individual frames

Check out Googlegooglegooglegoogle @ www.googlegooglegooglegoogle.com

    \"Reblog

    check out http://browsershots.org/

    If you are a web developer and are worried about how your website would look like in the various browsers and do not have the resources to test all the browsers, what do you do? Check out the webpage at

    http://browsershots.org/

    \"Reblog