-
Feb 4th, 2013, 09:01 PM
#1
Thread Starter
Hyperactive Member
Convert xls to csv remove double quotes
Hi can anyone help me? i am converting my xls file to csv file. I was able to convert my xls to csv
successfully but when i upload it to my online system created in php it says this is not a csv file.
This is because of the double quotes inside my CSV file
1, "alicia", "#61"
How can i remove double quotes in my xls file.
PLEASEE HELP!!!
I want to learn more
grace
-
Feb 4th, 2013, 09:43 PM
#2
Re: Convert xls to csv remove double quotes
You could use the REPLACE function
The next example will replace the doublequotes to spaces
Code:
SomeStr = Replace(SomeStr, Chr(34), "")
JG
... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...
-
Feb 4th, 2013, 09:50 PM
#3
Thread Starter
Hyperactive Member
Re: Convert xls to csv remove double quotes
thanks for the reply. I will try that
I want to learn more
grace
-
Feb 4th, 2013, 10:17 PM
#4
Thread Starter
Hyperactive Member
Re: Convert xls to csv remove double quotes
is there other way aside from changing my code? how about in excel 2010 is there techniques to convert xls to csv without having a double quotes after converting?
below is the code in php if i have double quotes it says this is not a php file.
if($_FILES["file"]["type"] != "application/vnd.ms-excel"){
die("This is not a CSV file.");
}
elseif(is_uploaded_file($_FILES['file']['tmp_name'])){
...actions
}
Last edited by VBcielle; Feb 4th, 2013 at 10:22 PM.
I want to learn more
grace
-
Feb 5th, 2013, 09:24 AM
#5
Re: Convert xls to csv remove double quotes
Just save the excel file as .csv
JG
... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...
-
Feb 5th, 2013, 08:50 PM
#6
Thread Starter
Hyperactive Member
Re: Convert xls to csv remove double quotes
Originally Posted by jggtz
Just save the excel file as .csv
It has double quotes 1, "reyes", jing when i just save as csv.
I want it to look like 1, reyes, jing.
I want to learn more
grace
-
Feb 5th, 2013, 09:58 PM
#7
Re: Convert xls to csv remove double quotes
well first, this won't work
if($_FILES["file"]["type"] != "application/vnd.ms-excel"){
as it's not an Excel file... it's a CSV... a text file. The reason you're getting the quotes is because the fields are text, which have the potential to contain commas themselves... so it puts the quotes on there so that it gets treated as a single field.
-tg
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|