Click here to Skip to main content
15,887,376 members
Home / Discussions / C#
   

C#

 
GeneralRe: Daft question on indenting text. Pin
Septimus Hedgehog4-Sep-13 6:00
Septimus Hedgehog4-Sep-13 6:00 
AnswerRe: Daft question on indenting text. Pin
Bernhard Hiller3-Sep-13 22:40
Bernhard Hiller3-Sep-13 22:40 
GeneralRe: Daft question on indenting text. Pin
Septimus Hedgehog4-Sep-13 0:15
Septimus Hedgehog4-Sep-13 0:15 
QuestionSubstring / Split String help Pin
Member 101198373-Sep-13 5:02
Member 101198373-Sep-13 5:02 
AnswerRe: Substring / Split String help Pin
Dave Kreskowiak3-Sep-13 5:30
mveDave Kreskowiak3-Sep-13 5:30 
GeneralRe: Substring / Split String help Pin
Member 101198373-Sep-13 5:39
Member 101198373-Sep-13 5:39 
GeneralRe: Substring / Split String help Pin
Dave Kreskowiak3-Sep-13 5:47
mveDave Kreskowiak3-Sep-13 5:47 
AnswerRe: Substring / Split String help Pin
BillWoodruff3-Sep-13 17:46
professionalBillWoodruff3-Sep-13 17:46 
I'm going to assume, based on what you describe, that you have no control over the "batch" of "entries" to be parsed here. Is that correct ?

The second issue is: to what extent is there any possible variation in the content of each "entry" you need to parse, and re-format ? As Dave pointed out to you, is it possible that the "name field" in each entry could vary, as in: Robert Smith; Robert T. Smith; Robert Thomas Smith; R. T. Smith III; Robert Smith 3rd. ... and so forth.

The extent to which you can establish the "variation" possible in the entries imho is going to determine the complexity of either:

1. creating a RegEx as Dave suggested.

2. taking your "batch" and transforming it into another "batch" in which you have inserted de-limiters so that you can, then, use string.Split.

I would likely write code to transform the original data (file, stream, whatever) and insert delimiters, simply because I am not expert in RegEx, and the C# code I'd write, imho, might be more maintainable, and re-usable. However, I would not doubt that someone like Dave could write a documented RegEx expression of great internal complexity that would be equally maintainable, and re-usable. So your choice may depend on what you are most expert in using now, and, given a need, for other people in the future to update, maintain, re-use, your code what those people are likely to be expert in.

Now, if the data was in XML format, you might be looking at defining an xsd to handle transformation.

good luck, Bill
Google CEO, Erich Schmidt: "I keep asking for a product called Serendipity. This product would have access to everything ever written or recorded, know everything the user ever worked on and saved to his or her personal hard drive, and know a whole lot about the user's tastes, friends and predilections." 2004, USA Today interview

AnswerRe: Substring / Split String help Pin
Forbiddenx4-Sep-13 4:59
Forbiddenx4-Sep-13 4:59 
Question"Handle" Pin
Bernhard Hiller3-Sep-13 3:07
Bernhard Hiller3-Sep-13 3:07 
AnswerRe: "Handle" Pin
Dave Kreskowiak3-Sep-13 3:49
mveDave Kreskowiak3-Sep-13 3:49 
GeneralRe: "Handle" Pin
Bernhard Hiller3-Sep-13 21:43
Bernhard Hiller3-Sep-13 21:43 
GeneralRe: "Handle" Pin
Dave Kreskowiak4-Sep-13 1:16
mveDave Kreskowiak4-Sep-13 1:16 
QuestionI can not Update my table when I want to check duplicate Records ... Pin
smh13923-Sep-13 2:00
smh13923-Sep-13 2:00 
AnswerRe: I can not Update my table when I want to check duplicate Records ... Pin
Bernhard Hiller3-Sep-13 22:47
Bernhard Hiller3-Sep-13 22:47 
GeneralRe: I can not Update my table when I want to check duplicate Records ... Pin
smh13924-Sep-13 3:27
smh13924-Sep-13 3:27 
QuestionCustomizing Solid Edge Pin
rani21072-Sep-13 20:11
rani21072-Sep-13 20:11 
AnswerRe: Customizing Solid Edge Pin
Pete O'Hanlon2-Sep-13 20:23
mvePete O'Hanlon2-Sep-13 20:23 
GeneralRe: Customizing Solid Edge Pin
rani21073-Sep-13 2:05
rani21073-Sep-13 2:05 
GeneralRe: Customizing Solid Edge PinPopular
Pete O'Hanlon3-Sep-13 2:11
mvePete O'Hanlon3-Sep-13 2:11 
GeneralRe: Customizing Solid Edge Pin
rani21073-Sep-13 2:25
rani21073-Sep-13 2:25 
GeneralRe: Customizing Solid Edge Pin
Dave Kreskowiak3-Sep-13 3:38
mveDave Kreskowiak3-Sep-13 3:38 
GeneralRe: Customizing Solid Edge Pin
Rohini Shirke3-Sep-13 18:19
Rohini Shirke3-Sep-13 18:19 
GeneralRe: Customizing Solid Edge Pin
Dave Kreskowiak4-Sep-13 1:09
mveDave Kreskowiak4-Sep-13 1:09 
AnswerRe: Customizing Solid Edge Pin
Abhinav S2-Sep-13 22:51
Abhinav S2-Sep-13 22:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.