1. Sid Price
  2. Valentina Database ADK
  3. Mittwoch, August 31 2016, 04:17 PM
  4.  Abonnieren via E-Mail
It appears that if a CSV file has blank lines at the end of it the ADK method "Import" places a record into the database. For example with this CSV file:

"fldID","fldName"
1,"Sig_1_30"
2,"Sig_2_30"
3,"Sig_3_30"
<- blank line
<-

I get the following into my table:

fldID fldName
1 Sig_1_30
2 Sig_2_30
3 Sig_3_30
0

Sid
Kommentar
There are no comments made yet.
Ruslan Zasukhin Akzeptierte Antwort
well, this is logical

\t\t this is NULL value for a field.
\n this is one more row into table
Kommentar
There are no comments made yet.
Sid Price Akzeptierte Antwort
I must disagree here.

First the delimeter is "," and not "\t".
Second when the line has ONLY "\n" there are no fields defined AT ALL, so the "\t\t" or ",," pattern is not present either. An empty line should not generate records in the database.

What is in the CSV file is:
"fldID","fldName"
1,"Sig_1_30\n"
2,"Sig_2_30\n"
3,"Sig_3_30\n"
\n
Kommentar
There are no comments made yet.
Ruslan Zasukhin Akzeptierte Antwort
1) okay let be coma

,, this is NULL value for a field.


2) well, this is how it works now...
And input file should follow strictly to required format.


* Do you have only one such empty line at the end of file?
* Where from this file comes? I mean it is generated by some other app?
I think we are able eat files from different sources.
So I wonder, where from this one?
Kommentar
There are no comments made yet.
Sid Price Akzeptierte Antwort
The file was generated by me, by hand in a text editor. Yes I made a mistake, however software should "degrade gracefully" under error conditions and NOT generate bad data into the database.
This was at the end of the file, I also believe that regardless of where it occurs an empty line should be skipped and not place bad data into the database.
Kommentar
There are no comments made yet.
Ruslan Zasukhin Akzeptierte Antwort
Sid,

they are not Bad data.

Image that somebody want insert such empty rows.
We should not close way for such wish.
Kommentar
There are no comments made yet.
Sid Price Akzeptierte Antwort
You already described how to enter an empty row, simply put "\t\t\n" or ",,\n" in the file. A line that is just "\n" is not a blank row, even by your definition.

This explicitly defines a blank row, just a "\n" does not.
Kommentar
There are no comments made yet.
  • Seite :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 0 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories
Omegabundle
  1. 0 subcategories