1. Sid Price
  2. Valentina Database ADK
  3. 水, 8月 31 2016, 04:17 PM
  4.  メールで購読
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
コメント
There are no comments made yet.
Ruslan Zasukhin 承諾済みの回答
well, this is logical

\t\t this is NULL value for a field.
\n this is one more row into table
コメント
There are no comments made yet.
Sid Price 承諾済みの回答
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
コメント
There are no comments made yet.
Ruslan Zasukhin 承諾済みの回答
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?
コメント
There are no comments made yet.
Sid Price 承諾済みの回答
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.
コメント
There are no comments made yet.
Ruslan Zasukhin 承諾済みの回答
Sid,

they are not Bad data.

Image that somebody want insert such empty rows.
We should not close way for such wish.
コメント
There are no comments made yet.
Sid Price 承諾済みの回答
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.
コメント
There are no comments made yet.
  • ページ :
  • 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. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories