Eskil

Check-in [758f82f447]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Autodetect semicolon separator. Feed GUI sep back to plugin.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 758f82f4473c57cea352dc6c931f2e2c6f7de369
User & Date: peter 2016-08-21 19:40:47.279
Context
2016-08-21
21:17
Correct font in table view. check-in: 912173d603 user: peter tags: trunk
19:40
Autodetect semicolon separator. Feed GUI sep back to plugin. check-in: 758f82f447 user: peter tags: trunk
2016-08-19
15:30
GUI support for table and separator. check-in: ceab939d5e user: peter tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Added examples/dir1/csv2.txt.
































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
head1	head2	head3	head4	head5	head6	head7	head8	head9	head10
MCPM	JFPC	FJ9S9	J1J	CC3	72<C	;P>HJ	RN?I	O48	BH<<
RKBO	@P:	GGG0	=8FNP	P6K	I@4	44H	48RG	1ODB:	SN:O?
CM7	M75	PML7@	I1:	EMRL	KHK	J3IQ	N4:CJ	2H:F=	L;9I
a	b	c	d	e	f	g	h	i	j
9R6	MQPJA	BL1	0NCR	6BEH0	DC=	D@F	I9J19	L8M99	DQHEE
GGK	OB?PM	I9S;K	060	AHO=8	JC46O	J>=	11?	QNEP	I1Q
:9E<C	P1S	R=PG?	SI=	<P0L5	6<C5<	=P?5E	E5HE?	@L=	N=P=1
0>A	3LPO	>27	BHA6	A3<	ODLH	01?L5	HL<D	SPR>J	KF>S=
601	QK<26	1H>	PAQ	H2P	C@=	J?59<	;MG	E>8KF	BD6I
M>SR	KA3L	PJG	HMF=G	<79I	B3;4<	1>D	JOPM	K:R7	HK<
CK9NB	G;10O	<M6=	>K2;	S6>7	O12KG	@RM	QN>	=<1<	D?CJ
PM2;K	JPQR?	<;7C3	H5SO	6M9	OL;@D	?4H>I	Q3F	E8ODJ	2P;<Q
7O94	?LFG	R=4M	<RLO7	0MHF	3K:?	ENG	8@@HG	?>2O	C7QN=
F036	>FOG0	EI<91	2H5P1	AAPP?	N58HI	RRRN;	J?A6B	;:;C	19KL
SG?H2	:<7	NLS@0	=7GA	5IJ	MLQO	4N0>=	9SRJ	7<?F:	N?9NF
;0I	J8;1:	O>?PM	>P9E5	1O9	=5?	JCGB	A940	D;8MB	B2L
E8Q2F	D12L	JL7ME	P0QPN	6@B	FEHI	QAF69	PIK	4KO	:C?
G8:	J19EL	?2L	6EOBA	D:B	6N>	2G2	F6<	@B8	@BNC?
ERG0J	:7R	DCD	QBBNQ	OBB1	G8@	9QNE	D3S	306	HCM?S
4MJ	;C4	:72BJ	=M;5	64@	:73:3	3SO	?SRJO	59<L9	@N63
63N	1RG	HS9	7AR=	2G8P	SGS	5IH1H	7QD0	=15Q	NC5
FBH;;	H@2S?	21N?	;NMCG	D4S<	<>R	73HHF	4=2	?J?7	C0;
KPG64	QI442	3OCQ	50C2K	M>9C	>9<	CNA1J	>9Q	@RJ4S	899
3;RS	H3;@5	<:C	1OAL	J=85K	PI6	OIA	FQ4S	H?53P	;SBD4
?==	<0A;	:3;Q	3FH	<3N	=D0	ASSH	>E1M	E44I	5S:
RRHBE	0A1M:	DKLIA	NSN	KA:@	BG3	=193	6G;6E	H92	<J4B
:72	6DH6O	OBI	5GOB	0R39:	<<C	6H:	<297	2E;MO	0MCR
A6LN	RD2S	AD20	F7:9	7PJ4@	O@4:9	O92	60I	1AE<	LBN
<NOC	;;9	DAI	C;@<<	?1P1	P?LEM	2GC	::IC	S=DO	?<GIS
;MS	K5HM	8HEP	<0=N	5HJC	15P@O	MSORD	9;NF	R;>@	MS?BR
KPFLI	A>LCB	Q:?C	<?H	8<JH	<@LM8	A06GB	?=R:>	72P	EME
Added examples/dir2/csv2.txt.
































































>
>
>
>
>
>
>
>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	HCM?S
4MJ	;C4	:72BJ	=M;5	64@	?1A0D	3SO	A2C7	59<L9	?5B<
63N	1RG	HS9	7AR=	2G8P	SGS	5IH1H	7QD0	=15Q	NC5
FBH;;	H@2S?	21N?	;NMCG	D4S<	<>R	73HHF	4=2	?J?7	C0;
KPG64	QI442	3OCQ	50C2K	M>9C	>9<	CNA1J	>9Q	@RJ4S	899
3;RS	H3;@5	<73	1OAL	J=85K	PI6	OIA	FQ4S	H?53P	;SBD4
?==	<0A;	:3;Q	3FH	<3N	=D0	ASSH	:>M	E44I	5S:
RRHBE	0A1M:	DKLIA	=DM	KA:@	66S6	=193	6G;6E	H92	<J4B
:72	6DH6O	OBI	5GOB	0R39:	<<C	LFQ<	<297	2E;MO	<S9AI
a	b	c	d	e	f	g	h	i	j
A6LN	RD2S	AD20	F7:9	7PJ4@	O@4:9	O92	60I	1AE<	LBN
<NOC	;;9	DAI	C;@<<	?1P1	P?LEM	2GC	::IC	S=DO	?<GIS
;MS	K5HM	8HEP	<0=N	5HJC	15P@O	MSORD	9;NF	R;>@	MS?BR
KPFLI	A>LCB	Q:?C	D49J?	KKCI	<@LM8	A06GB	?=R:>	72P	EME
Changes to src/eskil.tcl.
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287

1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301




1302
1303











1304
1305
1306
1307
1308
1309
1310
    if {$::eskil($top,mode) eq "rev"} {
        prepareRev $top
        lappend ::eskil($top,cleanup) "rev"
    } elseif {$::eskil($top,mode) eq "conflict"} {
        prepareConflict $top
        lappend ::eskil($top,cleanup) "conflict"
    }
    # Autodetect separator before any plugin processing
    set ::eskil($top,separator) \
            [subst -nocommand -novariable $::eskil($top,separatorview)]

    if {$::eskil($top,view) eq "table" && $::eskil($top,separator) eq ""} {
        set ch1 [open $::eskil($top,leftFile)]
        gets $ch1 line1
        close $ch1
        # Any tab or comma?
        if {[regsub -all "\t" $line1 "\t" _] >= 2} {
            set ::eskil($top,separator) "\t"
            set ::eskil($top,separatorview) "\\t"
            # Make it look like it came from command line
            lappend ::eskil(argv) -sep "\t"
        } elseif {[regsub -all "," $line1 "," _] >= 2} {
            set ::eskil($top,separator) ","
            set ::eskil($top,separatorview) ","
            lappend ::eskil(argv) -sep ","




        }
    }











    if {$::eskil($top,plugin) ne "" && \
                [dict get $::eskil($top,pluginpinfo) file]} {
        preparePlugin $top
        set ::eskil($top,cleanup) "plugin $::eskil($top,cleanup)"
    }
}








|


>




|



<
<




>
>
>
>


>
>
>
>
>
>
>
>
>
>
>







1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296


1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
    if {$::eskil($top,mode) eq "rev"} {
        prepareRev $top
        lappend ::eskil($top,cleanup) "rev"
    } elseif {$::eskil($top,mode) eq "conflict"} {
        prepareConflict $top
        lappend ::eskil($top,cleanup) "conflict"
    }
    # Prepare Separator
    set ::eskil($top,separator) \
            [subst -nocommand -novariable $::eskil($top,separatorview)]
    # Autodetect separator before any plugin processing
    if {$::eskil($top,view) eq "table" && $::eskil($top,separator) eq ""} {
        set ch1 [open $::eskil($top,leftFile)]
        gets $ch1 line1
        close $ch1
        # Any tab, comma or semicolon?
        if {[regsub -all "\t" $line1 "\t" _] >= 2} {
            set ::eskil($top,separator) "\t"
            set ::eskil($top,separatorview) "\\t"


        } elseif {[regsub -all "," $line1 "," _] >= 2} {
            set ::eskil($top,separator) ","
            set ::eskil($top,separatorview) ","
            lappend ::eskil(argv) -sep ","
        } elseif {[regsub -all ";" $line1 ";" _] >= 2} {
            set ::eskil($top,separator) ";"
            set ::eskil($top,separatorview) ";"
            lappend ::eskil(argv) -sep ";"
        }
    }
    # Make it look like it came from command line
    # It could come from the GUI or auto-detect, put it in the command line
    # to make it visible for plugins.
    set i [lsearch -exact $::eskil(argv) "-sep"]
    if {$i >= 0} {
        incr i
        lset ::eskil(argv) $i $::eskil($top,separatorview)
    } else {
        lappend ::eskil(argv) -sep
    }
    # Prepare plugin
    if {$::eskil($top,plugin) ne "" && \
                [dict get $::eskil($top,pluginpinfo) file]} {
        preparePlugin $top
        set ::eskil($top,cleanup) "plugin $::eskil($top,cleanup)"
    }
}