- Notifications
You must be signed in to change notification settings - Fork5
Commit82bade7
committed
dbf2pg - Insert xBase-style .dbf-files into a PostgreSQL-table
There is an option "-s oldname=newname", which changes the old field name of the dbf-file to the newname in PostgeSQL. If the length of the new name is 0, the field is skiped. If you want to skip the first field of the dbf-file, you get the wildest error-messages from the backend. dbf2pg load the dbf-file via "COPY tablename FROM STDIN". If you skip the first field, it is an \t to much in STDIN.A fix could be an counter j=0, which increments only, if a field is imported(IF (strlen(fields[h].db_name)> 0) j++. And only if j > 1 (if an other field isimported) the \t is printed.An other small bug in the README:-s start Specify the first record-number in the xBase-file we will insert.should be-e start Specify the first record-number in the xBase-file we will insert.Thomas Behr1 parent52347b6 commit82bade7
3 files changed
+23
-11
lines changedLines changed: 9 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
15 |
| - | |
| 15 | + | |
16 | 16 |
| |
17 | 17 |
| |
18 | 18 |
| |
| |||
70 | 70 |
| |
71 | 71 |
| |
72 | 72 |
| |
73 |
| - | |
| 73 | + | |
74 | 74 |
| |
75 | 75 |
| |
76 |
| - | |
77 |
| - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
78 | 82 |
| |
79 | 83 |
| |
80 | 84 |
| |
81 |
| - | |
| 85 | + | |
82 | 86 |
| |
83 | 87 |
| |
84 | 88 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
12 |
| - | |
| 11 | + | |
| 12 | + | |
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
| |||
78 | 78 |
| |
79 | 79 |
| |
80 | 80 |
| |
81 |
| - | |
| 81 | + | |
82 | 82 |
| |
83 | 83 |
| |
84 | 84 |
| |
|
Lines changed: 11 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
194 | 194 |
| |
195 | 195 |
| |
196 | 196 |
| |
197 |
| - | |
| 197 | + | |
198 | 198 |
| |
199 | 199 |
| |
200 | 200 |
| |
| |||
359 | 359 |
| |
360 | 360 |
| |
361 | 361 |
| |
| 362 | + | |
362 | 363 |
| |
363 | 364 |
| |
364 | 365 |
| |
| |||
442 | 443 |
| |
443 | 444 |
| |
444 | 445 |
| |
| 446 | + | |
445 | 447 |
| |
446 | 448 |
| |
447 |
| - | |
| 449 | + | |
| 450 | + | |
448 | 451 |
| |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
449 | 457 |
| |
450 |
| - | |
| 458 | + | |
451 | 459 |
| |
452 | 460 |
| |
453 | 461 |
| |
|
0 commit comments
Comments
(0)