Ask a Question related to ASP Database, Design and Development.
-
Nicolae Fieraru #1
Split(row, ",") when some values contain comma
Hi All,
I have a few CSV files and their content is like this:
"1","ABC","DEF,GHI","FGH"
You can notice that a cell contains the value "DEF,GHI" with a comma
I would like to split this row into values. If I use Split(row,",") then the
above value will be splited into "DEF" and "GHI" and I don't want this. How
can I split the row into correct values?
Regards,
Nicolae
Nicolae Fieraru Guest
-
Reading values from menubar dataProvider for "top" menuitems
I have a XML file that looks like this: <?xml version="1.0" encoding="ISO-8859-1" ?> <root> <menuitem label="Home" value="2" /> <menuitem... -
Passing "invisible" values for site flow
I have a login screen that takes an email address as the username and then a password. This user/pass combo is stored in a database. I've written... -
Problem with DataGrid and values that are empty when AutoGenerateColumns="False"
Hi! Im currently writing my Master Thesis in Computer Science and i have get caught in a strange DataGrid problem. Im using a DataGrid with 4... -
Make text boxes "forget" values
Hi Jonathan! I believe that the IsPostBack property is what you're looking for. You can add code to the page_load event that looks something... -
Specifying "do not update" values in "additive" UPDATE sprocs
Hello, I want to write a sproc whose purpose is to perform 'additive' UPDATEs to a given table. By 'additive', I mean I would like the existing... -
Manohar Kamath [MVP] #2
Re: Split(row, ",") when some values contain comma
You could split on "," instead of just ,
Split(row, Chr(34) & "," & Chr(34))
Then handle the leading " for the first array element, and trailing " for
the last array element.
--
Manohar Kamath
Editor, .netBooks
[url]www.dotnetbooks.com[/url]
"Nicolae Fieraru" <nospam@please.com> wrote in message
news:%23zMRL8ncDHA.616@TK2MSFTNGP11.phx.gbl...the> Hi All,
>
> I have a few CSV files and their content is like this:
>
> "1","ABC","DEF,GHI","FGH"
>
> You can notice that a cell contains the value "DEF,GHI" with a comma
>
> I would like to split this row into values. If I use Split(row,",") thenHow> above value will be splited into "DEF" and "GHI" and I don't want this.> can I split the row into correct values?
>
> Regards,
> Nicolae
>
>
>
>
Manohar Kamath [MVP] Guest
-
Nicolae Fieraru #3
Re: Split(row, ",") when some values contain comma
Hi Manohar,
Thank you very much for your tip, I already found an earlier message of
yours and it helped me.
Regards,
Nicolae
"Manohar Kamath [MVP]" <mkamath@TAKETHISOUTkamath.com> wrote in message
news:#gb5IgocDHA.2672@tk2msftngp13.phx.gbl...> You could split on "," instead of just ,
>
> Split(row, Chr(34) & "," & Chr(34))
>
> Then handle the leading " for the first array element, and trailing " for
> the last array element.
>
> --
> Manohar Kamath
> Editor, .netBooks
> [url]www.dotnetbooks.com[/url]
>
>
> "Nicolae Fieraru" <nospam@please.com> wrote in message
> news:%23zMRL8ncDHA.616@TK2MSFTNGP11.phx.gbl...> the> > Hi All,
> >
> > I have a few CSV files and their content is like this:
> >
> > "1","ABC","DEF,GHI","FGH"
> >
> > You can notice that a cell contains the value "DEF,GHI" with a comma
> >
> > I would like to split this row into values. If I use Split(row,",") then> How> > above value will be splited into "DEF" and "GHI" and I don't want this.>> > can I split the row into correct values?
> >
> > Regards,
> > Nicolae
> >
> >
> >
> >
>
Nicolae Fieraru Guest
-
Ken Schaefer #4
Re: Split(row, ",") when some values contain comma
What if it's not "several values" but a piece of text that happens to
contain a comma?
Cheers
Ken
"Harag" <harag@softhome.net> wrote in message
news:4judlvg0vi0ti6qcsqhfk7u44m1qt6nki4@4ax.com...
: what I normally do when I store several values in one field is to use
: a PIPE character "|"
:
: eg:
: "1","ABC","DEF|GHI","FGH"
:
: HTH
: Al.
:
: On Thu, 4 Sep 2003 10:55:08 +1000, "Nicolae Fieraru"
: <nospam@please.com> wrote:
:
: >Hi All,
: >
: >I have a few CSV files and their content is like this:
: >
: >"1","ABC","DEF,GHI","FGH"
: >
: >You can notice that a cell contains the value "DEF,GHI" with a comma
: >
: >I would like to split this row into values. If I use Split(row,",") then
the
: >above value will be splited into "DEF" and "GHI" and I don't want this.
How
: >can I split the row into correct values?
: >
: >Regards,
: >Nicolae
: >
: >
: >
:
Ken Schaefer Guest
-
Don Verhagen #5
Re: Split(row, ",") when some values contain comma
In news:jikelvgl2pte5d3a88ctfkrvm8k1lhv4v3@4ax.com,
Harag <harag@softhome.net> typed:
: Yeah thats the problem. It does really depend what the developer is
: going to store. I was just giving them something else to think about
: :) since the "|" (pipe) character is not used when typing normal text.
However the *standard* comma separate values (CSV) file allows quoted text
to contain commas (the delimiter). So unless you're going to change all
those applications (including Excel, etc.) the OP will have to deal with it.
However, I understand your point also, when I have a choice I use tabs to
separate field values. It wasn't a criticism, just pointing out the fact
that the OP may not have control of the application producting the CSV file
and the CSV is in a standard format.
Don Verhagen
: It was kind of you to point this out as I did forget to mention it
: earlier :)
:
: thanks.
: Al
:
: On Thu, 4 Sep 2003 20:49:19 +1000, "Ken Schaefer"
: <kenREMOVE@THISadOpenStatic.com> wrote:
:
:: What if it's not "several values" but a piece of text that happens to
:: contain a comma?
::
:: Cheers
:: Ken
::
::
:: "Harag" <harag@softhome.net> wrote in message
:: news:4judlvg0vi0ti6qcsqhfk7u44m1qt6nki4@4ax.com...
::: what I normally do when I store several values in one field is to
::: use
::: a PIPE character "|"
:::
::: eg:
::: "1","ABC","DEF|GHI","FGH"
:::
::: HTH
::: Al.
:::
::: On Thu, 4 Sep 2003 10:55:08 +1000, "Nicolae Fieraru"
::: <nospam@please.com> wrote:
:::
:::: Hi All,
::::
:::: I have a few CSV files and their content is like this:
::::
:::: "1","ABC","DEF,GHI","FGH"
::::
:::: You can notice that a cell contains the value "DEF,GHI" with a
:::: comma
::::
:::: I would like to split this row into values. If I use
:::: Split(row,",") then the above value will be splited into "DEF" and
:::: "GHI" and I don't want this. How can I split the row into correct
:::: values?
::::
:::: Regards,
:::: Nicolae
Don Verhagen Guest



Reply With Quote

