Created
October 29, 2013 17:52
-
-
Save jakob-stoeck/7219471 to your computer and use it in GitHub Desktop.
Copies SequelPro results as a textile table to use it in Redmine or other textile-supported systems. To use, just copy it into your SequelPro Bundle Editor.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
$in = fopen('php://stdin', 'r'); | |
$result=array(); | |
$format='_.'; | |
while($line=fgetcsv($in, 0, "\t")) { | |
$result[]='|'.$format.implode('|'.$format, $line).'|'; | |
$format=''; | |
} | |
fclose($in); | |
$cmd='echo '.escapeshellarg(implode("\n", $result)).' | __CF_USER_TEXT_ENCODING='.posix_getuid().':0x8000100:0x8000100 pbcopy'; | |
shell_exec($cmd); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks, this was a good starting point for a similar format I needed.