Problem with Split Function

Neerja

Registered User.
Local time
Today, 22:43
Joined
May 22, 2006
Messages
11
I am trying to upload some data from a .csv file to access table.
For this I am using Input Line and then using the split function with “,” as delimiter to put the values in an array and then upload it to access.

The file that I want to upload, has a number column as amount. It has no $ sign and is listed in the file as say 5,0750,99.03.

When I try to split it, it splits the amount as welll giving me 5 and 0750 amd 99.03 as separate array item.

Any suggestions please??

Thanks in advance
 
You are toast I am sorry to say... If you have fields like this in a Comma seperated file, you are simply put Toast. You will need to fix it by concatinating the seperate fields.

Offcourse the problem probably is that you can have 5 million (giving 3 seperate fields) or just 5 euro (giving just 1 field)

Best thing to do is either change the filespec or not use split but do it by hand.
Doing it by hand, hopefully you only have one problem field like this. If so you can use Instr and InstrRev to find your seperate fields. And the split the fields of manually using Mid, left and Right functions to cut your fields out.

Related question: Why are you not using the normal Access import function??

Not Related: Why did you post your question twice?
 
just one thought - how is the csv created? - if it was in excel you might have double quotes around the field with commas in it - if this is the case, you can open it up in excel and do a find / replace to replace the commas with something else (eg periods or nothing)
 
Why not just import it using the built in CSV functions?
 
are there any spaces around the commas that you can specify in the split function? give a sample line.
 

Users who are viewing this thread

Back
Top Bottom