# Jscript: Removing commas from a CSV file

**URL:** https://forum.kirupa.com/t/jscript-removing-commas-from-a-csv-file/229630
**Category:** web dev
**Created:** [June 19, 2007, 2:53am UTC](https://forum.kirupa.com/t/jscript-removing-commas-from-a-csv-file/229630 "2007-06-19T02:53:33Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![RussianBeer](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/russianbeer/32/152_2.png) [@RussianBeer](https://forum.kirupa.com/u/RussianBeer)
#### Post date: [June 19, 2007, 2:53am UTC](https://forum.kirupa.com/t/jscript-removing-commas-from-a-csv-file/229630/1 "2007-06-19T02:53:33Z")

</div>

## Hi guys So I have this code, people register on a form, this then goes to a Access file. Then there is a functions that exports the code to an CSV file! The code works fine, the problem is as follows; On the form there is a field [Address] and people put things like: [1122 Main Street, apt 402] Which looks fine, but notice that “comma”? What happends is when I export it in to CSV, those commas create separated values (Hence the CSV file), and screws my tables complete up. So what I need to find out how to do is either; How do I let people type commas without it separating values, not affecting the CSV form. Or how do I forbid people from using commas in a form?

the script is like so:

```auto
var queryStreet = "";
if (String(Request.Form("street")) != "undefined" && 
    String(Request.Form("street")) != "") { 
  queryStreet = String(Request.Form("street"));
}

```

I tried changing it to this:

```auto

var queryStreet = "";
if (String(Request.Form("street")) != "undefined" && 
    String(Request.Form("street")) != "") { 
  queryStreet = String(Replace(Request.Form("street"), ",", ""));

```

But all I got was this:

```auto
Microsoft JScript runtime error '800a138f'
Object expected
/registrations/runningstart/reg_add.asp, line 43 

```
