|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Modifying a text filethis within a text file... Applications/Diabetic Registry/ Applications/Diabetic Registry/ Applications/Diabetic Registry/ Applications/Great Plains/ Applications/Great Plains/ Applications/Great Plains/ Applications/Great Plains/Servers/ Applications/Great Plains/Servers/ Applications/HeartBase/ Applications/HeartBase/ Applications/HeartBase/ Applications/HHC/ Applications/HHC/ Applications/HHC/ Applications/HHC/ I would want the result to be this: Applications/Diabetic Registry/ Applications/Great Plains/ Applications/Great Plains/Servers/ Applications/HeartBase/ Applications/HHC/ I've tried using StreamReader and StreamWriter simulataneously with no success...any other ideas? If the file isn't very large you could load all the lines of the file
into an array and remove duplicates from the array and rewrite the file. If you need code on how to remove duplicates using an array let me know and I'll post it. -Nelson soup_nazi wrote: Show quoteHide quote > I want to remove duplicate entries within a text file. So if I had > this within a text file... > > Applications/Diabetic Registry/ > Applications/Diabetic Registry/ > Applications/Diabetic Registry/ > Applications/Great Plains/ > Applications/Great Plains/ > Applications/Great Plains/ > Applications/Great Plains/Servers/ > Applications/Great Plains/Servers/ > Applications/HeartBase/ > Applications/HeartBase/ > Applications/HeartBase/ > Applications/HHC/ > Applications/HHC/ > Applications/HHC/ > Applications/HHC/ > > I would want the result to be this: > > Applications/Diabetic Registry/ > Applications/Great Plains/ > Applications/Great Plains/Servers/ > Applications/HeartBase/ > Applications/HHC/ > > I've tried using StreamReader and StreamWriter simulataneously with no > success...any other ideas? What does "no success" mean? Are you having trouble finding the unique
values or doing a read and a write in the same loop? In either case, I'm thinking that you could load each item into a collection that doesn't allow duplicates -- I can't think of which one you'd want off the top of my head, but there's probably something in the Framework that will suit -- then write the values back out to a file. Maybe you could post some pseudo code or describe the exact nature of your problem. Mitchell S. Honnert www.UltraID3Lib.com Show quoteHide quote "soup_nazi" <bcah***@wfs-ops.org> wrote in message news:1138040686.826773.312760@z14g2000cwz.googlegroups.com... >I want to remove duplicate entries within a text file. So if I had > this within a text file... > > Applications/Diabetic Registry/ > Applications/Diabetic Registry/ > Applications/Diabetic Registry/ > Applications/Great Plains/ > Applications/Great Plains/ > Applications/Great Plains/ > Applications/Great Plains/Servers/ > Applications/Great Plains/Servers/ > Applications/HeartBase/ > Applications/HeartBase/ > Applications/HeartBase/ > Applications/HHC/ > Applications/HHC/ > Applications/HHC/ > Applications/HHC/ > > I would want the result to be this: > > Applications/Diabetic Registry/ > Applications/Great Plains/ > Applications/Great Plains/Servers/ > Applications/HeartBase/ > Applications/HHC/ > > I've tried using StreamReader and StreamWriter simulataneously with no > success...any other ideas? > Soup_nazi,
Do you have an explenation for the Nick you are using. This is an International newsgoup. For some people in the world can the nick you use be quiet shocking. So please if you don't have a good explanation, change it. Cor
Show quote
Hide quote
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message Cor,news:%23r42FSFIGHA.2680@TK2MSFTNGP09.phx.gbl... > Soup_nazi, > > Do you have an explenation for the Nick you are using. > > This is an International newsgoup. For some people in the world can the nick > you use be quiet shocking. > > So please if you don't have a good explanation, change it. > > Cor > I believe his nickname is based on a character from a comedy television show called Seinfeld. This character had a shop where they sold very good soup. However, he had a very unpleasant personality and due to the way he behaved, the other characters on the show gave him the nickname Soup Nazi. Within the context of this show, it is very funny. However, taken out of context and without knowledge of the show, it very well could be shocking and/or offensive to others. From my point of view, I believe I can safely say that the poster has absolutely no intention of offending anyone. But since this is an International newsgroup, they might want to reconsider their chosen nickname. Gerald I would agree, have seen this show but has no place here.
Show quoteHide quote "Gerald Hernandez" <Cablewizard@spam_remove@Yahoo.com> wrote in message news:OYbYLuFIGHA.604@TK2MSFTNGP14.phx.gbl... > > "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message > news:%23r42FSFIGHA.2680@TK2MSFTNGP09.phx.gbl... >> Soup_nazi, >> >> Do you have an explenation for the Nick you are using. >> >> This is an International newsgoup. For some people in the world can the > nick >> you use be quiet shocking. >> >> So please if you don't have a good explanation, change it. >> >> Cor >> > > Cor, > > I believe his nickname is based on a character from a comedy television > show > called Seinfeld. > This character had a shop where they sold very good soup. However, he had > a > very unpleasant personality and due to the way he behaved, the other > characters on the show gave him the nickname Soup Nazi. Within the context > of this show, it is very funny. > > However, taken out of context and without knowledge of the show, it very > well could be shocking and/or offensive to others. From my point of view, > I > believe I can safely say that the poster has absolutely no intention of > offending anyone. But since this is an International newsgroup, they might > want to reconsider their chosen nickname. > > Gerald > > apologize for offending anyone...this was referring to a Seinfeld
character.
disable Close button (X)
Application doesn't close on Shut Down - Please help! Using pulldownlist in datagridview .. can it be done! Update error Intern Strings - am I using them right? Please help! Marking a changed row read the contents of Address bar in browser stringbuilder help Error- Type expected Refernece an assembly using a string |
|||||||||||||||||||||||