Skip to content

Commit e353ceb

Browse files
committed
init
0 parents  commit e353ceb

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed

csv2cliboard.pl

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#
2+
# csv2cliboard.pl
3+
#
4+
# das ding soll ein obscures dateiformat gerade biegen
5+
#
6+
use utf8;
7+
use Encode;
8+
use Win32::Clipboard;
9+
$CLIP = Win32::Clipboard();
10+
11+
#print join(/,/,@ARGV);
12+
13+
my $s;
14+
15+
while (my $z=<>) {
16+
$z= decode('utf8',$z);
17+
chomp $z;
18+
19+
my @f = split(",",$z);
20+
my @zf;
21+
22+
foreach (@f) {
23+
my $s=$_;
24+
25+
if ($_ =~ m/^(-?\d*)\.(\d+)$/ ) {
26+
$s=$1.",".$2;
27+
}
28+
29+
if ($_ =~ m/^(\d{1,2})\.(\d{1,2})\.(\d{4})/) {
30+
$s=$2.".".$1.".".$3;
31+
}
32+
33+
34+
push(@zf,$s);
35+
}
36+
37+
$s .= join("\t",@zf)."\n";
38+
}
39+
40+
$s= encode('latin1',$s);
41+
42+
$CLIP->Set($s);

csv2cliboard.zip

1.65 MB
Binary file not shown.

test.csv

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# kopf
2+
1,1234,abcdefgh
3+
2,123.567,öäüßÖÄÜ
4+
3,02.20.2017,hallo afdssa
5+
4,2.4.2017,hallo afdssa
6+
5,-123.567,öäüßÖÄÜ €@²³
7+
6,-.567,öäüßÖÄÜ €@²³
8+
7,.567,öäüßÖÄÜ €@²³

0 commit comments

Comments
 (0)