Hi all
I have a CSV file (MyFile.CSV) with a single line that looks like this: FIN005,,06/11/2020,06/11/2020,06/11/2020,T116434,C,,,,,,,N,,,,,,,8300,,-15,,-3,,,H,S,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,LEITH You can verify for yourselves that LEITH is the 58th column. I have a table (MyTable.DBF) with 66 fields and Field(58) returns SA_JOB
The following fails to populate SA_JOB
Select MyTable APPEND FROM MyFile.CSV TYPE DELIMITED
All the other columns are correct in the table. I am completely stumped so any help would be much appreciated.
Paul Newton
Hi Paul, I created a 60 col table (all character type) and append that line. The 58th col correctly has the word 'LEITH' So for me, it is behaving as expected. I have uploaded both the files to https://we.tl/t-txhbr0rAAM Ajit
On 23/11/2020 16:14, Paul Newton wrote:
Hi all
I have a CSV file (MyFile.CSV) with a single line that looks like this: FIN005,,06/11/2020,06/11/2020,06/11/2020,T116434,C,,,,,,,N,,,,,,,8300,,-15,,-3,,,H,S,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,LEITH You can verify for yourselves that LEITH is the 58th column. I have a table (MyTable.DBF) with 66 fields and Field(58) returns SA_JOB
The following fails to populate SA_JOB
Select MyTable APPEND FROM MyFile.CSV TYPE DELIMITED
All the other columns are correct in the table. I am completely stumped so any help would be much appreciated.
Paul Newton
[excessive quoting removed by server]
Thanks Ajit
Can I send you my table and CSV?
Paul
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Ajit Abraham Sent: 23 November 2020 14:14 To: profoxtech@leafe.com Subject: Re: Problem with APPEND FROM <Filename> TYPE DELIMITED
Sent by an external sender ------------------------------
Hi Paul, I created a 60 col table (all character type) and append that line. The 58th col correctly has the word 'LEITH' So for me, it is behaving as expected. I have uploaded both the files to https://we.tl/t-txhbr0rAAM Ajit
On 23/11/2020 16:14, Paul Newton wrote:
Hi all
I have a CSV file (MyFile.CSV) with a single line that looks like this: FIN005,,06/11/2020,06/11/2020,06/11/2020,T116434,C,,,,,,,N,,,,,,,8300,,-15,,-3,,,H,S,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,LEITH You can verify for yourselves that LEITH is the 58th column. I have a table (MyTable.DBF) with 66 fields and Field(58) returns SA_JOB
The following fails to populate SA_JOB
Select MyTable APPEND FROM MyFile.CSV TYPE DELIMITED
All the other columns are correct in the table. I am completely stumped so any help would be much appreciated.
Paul Newton
[excessive quoting removed by server]
Sure Paul.
On 23/11/2020 17:27, Paul Newton wrote:
Thanks Ajit
Can I send you my table and CSV?
Paul
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Ajit Abraham Sent: 23 November 2020 14:14 To: profoxtech@leafe.com Subject: Re: Problem with APPEND FROM <Filename> TYPE DELIMITED
Sent by an external sender
Hi Paul, I created a 60 col table (all character type) and append that line. The 58th col correctly has the word 'LEITH' So for me, it is behaving as expected. I have uploaded both the files to https://we.tl/t-txhbr0rAAM Ajit
On 23/11/2020 16:14, Paul Newton wrote:
Hi all
I have a CSV file (MyFile.CSV) with a single line that looks like this: FIN005,,06/11/2020,06/11/2020,06/11/2020,T116434,C,,,,,,,N,,,,,,,8300,,-15,,-3,,,H,S,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,LEITH You can verify for yourselves that LEITH is the 58th column. I have a table (MyTable.DBF) with 66 fields and Field(58) returns SA_JOB
The following fails to populate SA_JOB
Select MyTable APPEND FROM MyFile.CSV TYPE DELIMITED
All the other columns are correct in the table. I am completely stumped so any help would be much appreciated.
Paul Newton
[excessive quoting removed by server]
What's the structure of your DBF, notably the definition of the 58th field?
On Mon, Nov 23, 2020 at 9:14 PM Paul Newton Paul.Newton@pegasus.co.uk wrote:
I have a CSV file (MyFile.CSV) with a single line that looks like this: FIN005,,06/11/2020,06/11/2020,06/11/2020,T116434,C,,,,,,,N,,,,,,,8300,,-15,,-3,,,H,S,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,LEITH You can verify for yourselves that LEITH is the 58th column. I have a table (MyTable.DBF) with 66 fields and Field(58) returns SA_JOB
The following fails to populate SA_JOB
Select MyTable APPEND FROM MyFile.CSV TYPE DELIMITED
All the other columns are correct in the table. I am completely stumped so any help would be much appreciated.
Thanks Man-wai
Field 58 is SA_JOB C(8)
Paul -----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Man-wai Chang Sent: 23 November 2020 14:19 To: profoxtech@leafe.com Subject: [SUSPECTED SPAM] Re: Problem with APPEND FROM <Filename> TYPE DELIMITED
Sent by an external sender ------------------------------
What's the structure of your DBF, notably the definition of the 58th field?
On Mon, Nov 23, 2020 at 9:14 PM Paul Newton Paul.Newton@pegasus.co.uk wrote:
I have a CSV file (MyFile.CSV) with a single line that looks like this: FIN005,,06/11/2020,06/11/2020,06/11/2020,T116434,C,,,,,,,N,,,,,,,8300, ,-15,,-3,,,H,S,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,LEITH You can verify for yourselves that LEITH is the 58th column. I have a table (MyTable.DBF) with 66 fields and Field(58) returns SA_JOB
The following fails to populate SA_JOB
Select MyTable APPEND FROM MyFile.CSV TYPE DELIMITED
All the other columns are correct in the table. I am completely stumped so any help would be much appreciated.
-- .~. Might, Courage, Vision. SINCERITY! / v \ 64-bit Fedora 25 Server Spin /( _ )\ http://sites.google.com/site/changmw ^ ^ May the Force and farces be with you!
[excessive quoting removed by server]
Hi Paul,
cmd = "CREATE CURSOR mytable (" FOR ii = 1 TO 66 cmd = cmd + "F" + TRANSFORM(ii) + " c(10)" IF ii < 66 cmd = cmd + "," ENDIF NEXT cmd = cmd + ")" &cmd. Select MyTable APPEND FROM MyFile.CSV TYPE DELIMITED BROWSE LAST NOWAIT
F58 gets the value LEITH
I don't have a reason why your 58th field is being populated. List Structure of MyTable will give you the field number next to the field name. This may help you verify your table.
HTH, Tracy
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Paul Newton Sent: Monday, November 23, 2020 8:15 AM To: profoxtech@leafe.com Subject: Problem with APPEND FROM <Filename> TYPE DELIMITED
Hi all
I have a CSV file (MyFile.CSV) with a single line that looks like this: FIN005,,06/11/2020,06/11/2020,06/11/2020,T116434,C,,,,,,,N,,,,,,,8300,,-15,, -3,,,H,S,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,LEITH You can verify for yourselves that LEITH is the 58th column. I have a table (MyTable.DBF) with 66 fields and Field(58) returns SA_JOB
The following fails to populate SA_JOB
Select MyTable APPEND FROM MyFile.CSV TYPE DELIMITED
All the other columns are correct in the table. I am completely stumped so any help would be much appreciated.
Paul Newton
[excessive quoting removed by server]
Thanks Tracy
I know that SA_JOB is the 58th field in the table FIELD(58) returns SA_JOB
Paul
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Tracy Pearson Sent: 23 November 2020 14:19 To: profoxtech@leafe.com Subject: RE: Problem with APPEND FROM <Filename> TYPE DELIMITED
Sent by an external sender ------------------------------
Hi Paul,
cmd = "CREATE CURSOR mytable (" FOR ii = 1 TO 66 cmd = cmd + "F" + TRANSFORM(ii) + " c(10)" IF ii < 66 cmd = cmd + "," ENDIF NEXT cmd = cmd + ")" &cmd. Select MyTable APPEND FROM MyFile.CSV TYPE DELIMITED BROWSE LAST NOWAIT
F58 gets the value LEITH
I don't have a reason why your 58th field is being populated. List Structure of MyTable will give you the field number next to the field name. This may help you verify your table.
HTH, Tracy
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Paul Newton Sent: Monday, November 23, 2020 8:15 AM To: profoxtech@leafe.com Subject: Problem with APPEND FROM <Filename> TYPE DELIMITED
Hi all
I have a CSV file (MyFile.CSV) with a single line that looks like this: FIN005,,06/11/2020,06/11/2020,06/11/2020,T116434,C,,,,,,,N,,,,,,,8300,,-15,, -3,,,H,S,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,LEITH You can verify for yourselves that LEITH is the 58th column. I have a table (MyTable.DBF) with 66 fields and Field(58) returns SA_JOB
The following fails to populate SA_JOB
Select MyTable APPEND FROM MyFile.CSV TYPE DELIMITED
All the other columns are correct in the table. I am completely stumped so any help would be much appreciated.
Paul Newton
[excessive quoting removed by server]
Are you taking into account that there's a memo field in there, into which with CSV you can't import ?
Alan
That's what the problem turned out to be ...
Paul -----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Alan Bourke Sent: 24 November 2020 07:38 To: profoxtech@leafe.com Subject: Re: Problem with APPEND FROM <Filename> TYPE DELIMITED
Sent by an external sender ------------------------------
Are you taking into account that there's a memo field in there, into which with CSV you can't import ?
-- Alan Bourke alanpbourke (at) fastmail (dot) fm
[excessive quoting removed by server]
Having said that it works for me with or without the memo field in the DBF. Although field(58) only returns sa_job if you remove the memo field from the DBF.