Hi
I need to split a comma delimited text, however if the comma is between ' '
then no split should occur
ie:
Class.Value, 'true' , 'some text', 'false', 'text, text, text'
should split into:
Class.Value
'true'
'some text
'false', 'text, text, text'
what split expression should I use for that??
TIA
Sřren 5 2584
SMOlesen wrote: Hi
I need to split a comma delimited text, however if the comma is between ' ' then no split should occur
ie:
Class.Value, 'true' , 'some text', 'false', 'text, text, text'
should split into:
Class.Value 'true' 'some text
Why should the apostrophe be removed? Or is it a typo?
'false', 'text, text, text'
Why shouldn't it split between 'false' and 'text, text, text'?
what split expression should I use for that??
Sorry, it was a typo, it should split into:
Class.Value
'true'
'some text'
'false'
'text, text, text'
ie. it shouldn't split on comma if the comma is between two apostrophes....
..NET regular expression.....
"Göran Andersson" <gu***@guffa.com> wrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl... SMOlesen wrote: Hi
I need to split a comma delimited text, however if the comma is between ' ' then no split should occur
ie:
Class.Value, 'true' , 'some text', 'false', 'text, text, text'
should split into:
Class.Value 'true' 'some text
Why should the apostrophe be removed? Or is it a typo?
'false', 'text, text, text'
Why shouldn't it split between 'false' and 'text, text, text'?
what split expression should I use for that??
Make a pattern that matches one item, something like
"(?:([^,]+|'[^']*')", and use the Matches method to get a collection of
Match items that each contains one item.
SMOlesen wrote: Sorry, it was a typo, it should split into:
Class.Value 'true' 'some text' 'false' 'text, text, text'
ie. it shouldn't split on comma if the comma is between two apostrophes....
.NET regular expression.....
"Göran Andersson" <gu***@guffa.com> wrote in message news:%2****************@TK2MSFTNGP05.phx.gbl... SMOlesen wrote: Hi
I need to split a comma delimited text, however if the comma is between ' ' then no split should occur
ie:
Class.Value, 'true' , 'some text', 'false', 'text, text, text'
should split into:
Class.Value 'true' 'some text Why should the apostrophe be removed? Or is it a typo?
'false', 'text, text, text' Why shouldn't it split between 'false' and 'text, text, text'?
what split expression should I use for that??
Hi Göran
Doesn't seem to solve the problem, if I look at the matches I get:
Class.Value
'true'
'some text'
'false'
'text
text
text'
wouldn't I have to use som king of negative lookbehind??
Regards,
Sřren
"Göran Andersson" <gu***@guffa.com> wrote in message
news:eL****************@TK2MSFTNGP03.phx.gbl... Make a pattern that matches one item, something like "(?:([^,]+|'[^']*')", and use the Matches method to get a collection of Match items that each contains one item.
SMOlesen wrote: Sorry, it was a typo, it should split into:
Class.Value 'true' 'some text' 'false' 'text, text, text'
ie. it shouldn't split on comma if the comma is between two apostrophes....
.NET regular expression.....
"Göran Andersson" <gu***@guffa.com> wrote in message news:%2****************@TK2MSFTNGP05.phx.gbl... SMOlesen wrote: Hi
I need to split a comma delimited text, however if the comma is between ' ' then no split should occur
ie:
Class.Value, 'true' , 'some text', 'false', 'text, text, text'
should split into:
Class.Value 'true' 'some text Why should the apostrophe be removed? Or is it a typo?
'false', 'text, text, text' Why shouldn't it split between 'false' and 'text, text, text'?
what split expression should I use for that??
When I look at the pattern I gave you, I see that the parantheses
doesn't match, so it won't be usable. How did the pattern look that you
used?
I think that just disallowing apostrophes in the first set will fix it:
"([^',]+|'[^']*')"
Sřren M. Olesen wrote: Hi Göran
Doesn't seem to solve the problem, if I look at the matches I get:
Class.Value 'true' 'some text' 'false' 'text text text'
wouldn't I have to use som king of negative lookbehind??
Regards,
Sřren "Göran Andersson" <gu***@guffa.com> wrote in message news:eL****************@TK2MSFTNGP03.phx.gbl... Make a pattern that matches one item, something like "(?:([^,]+|'[^']*')", and use the Matches method to get a collection of Match items that each contains one item.
SMOlesen wrote: Sorry, it was a typo, it should split into:
Class.Value 'true' 'some text' 'false' 'text, text, text'
ie. it shouldn't split on comma if the comma is between two apostrophes....
.NET regular expression.....
"Göran Andersson" <gu***@guffa.com> wrote in message news:%2****************@TK2MSFTNGP05.phx.gbl... SMOlesen wrote: > Hi > > I need to split a comma delimited text, however if the comma is between > ' ' then no split should occur > > ie: > > Class.Value, 'true' , 'some text', 'false', 'text, text, text' > > should split into: > > Class.Value > 'true' > 'some text Why should the apostrophe be removed? Or is it a typo?
> 'false', 'text, text, text' Why shouldn't it split between 'false' and 'text, text, text'?
> what split expression should I use for that?? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Arne |
last post by:
From: "Arne de Booij" <a_de_booij@hotmail.com>
Subject: Comma delimited array into DB problems
Date: 9. februar 2004 10:39
Hi,
I have an asp page that takes input from a form on the previous...
|
by: Christine Forber |
last post by:
I wonder if anyone knows of some javascript code to check a
comma-delimited list of email addresses for basic formating.
What I'm looking for is the javascript code to check a form field on
form...
|
by: William Stacey [MVP] |
last post by:
Would like help with a (I think) a common regex split example. Thanks for
your example in advance. Cheers!
Source Data Example:
one "two three" four
Optional, but would also like to...
|
by: Joe Fisherman |
last post by:
I have used regex to parse a huge text file, and grab a tab delimited
portion of it. I often use comma delimited text files, and use Jet Oledb4.
I read that I would need an ini if the file wasn't...
|
by: Bernie Yaeger |
last post by:
Is there a way to convert or copy a .xml file to a comma delimited text file
using vb .net?
Thanks for any help.
Bernie Yaeger
|
by: JustSomeGuy |
last post by:
Hi. I have a comma delimited text file that I want to parse.
I was going to use fscanf from the C library but as my app is written
in C++
I thought I'd use the std io stream library...
My Text...
|
by: Ron |
last post by:
so if my textbox is named textbox1 and my listbox is named
ltsdisplay, for the button that would make this all happen I would
just need to:
...
|
by: conspireagainst |
last post by:
I'm having quite a time with this particular problem:
I have users that enter tag words as form input, let's say for a photo or a topic of discussion. They are allowed to delimit tags with spaces...
|
by: =?Utf-8?B?bWFnZ2ll?= |
last post by:
hi,
I need some help with a reg. expression. I have a comma delimited file with
quotes. Not every field has quotes, only some. This is a sample of my file:...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| | |