|
lol, he could convert a file of 8MB in 2,9 seconds. (including reading in and putting into the textbox), he used several different classes and he added different conversion methods for ASCII, UTF etc...)
My conversion, including reading in and putting into textbox was not even 20 lines .
|
|
|
|
|
1) Know what do you want
2) Be sure that what you want is meaningful and understandable
3) What does "convert it and show it in a textbox" means? Convert to what? Any rule, regular expression, upper-lower case, flower, tree, insect...what?
If you want to convert every occurance of a string to a reqular expression then use a predefined regular expression and trace the file with a buffer of whatever size your computer can handle. If the file size in not very big, you can read it completely into the memory at once and then process.
Hope this helps...
|
|
|
|
|
Actually i have data like in this format:
1aDOCSTART_3
DOCTYPE BILL
GENEVAVERSION 5.0
BILLSTYLE 2
BILLTYPE 1
BILLTEMPLATE 3
BILLSEQ 1
BILLVERSION 1
ACCCURRENCYCODE GBP
BILLLANGID 1
BILLLANGNAME English (UK)
BILLLANGLOCALE en_GB
Our requirement is to parse this file into attribute value pairs. like:
GENEVAVERSION : 5.0
BILLSTYLE : 2
BILLTYPE : 1
BILLTEMPLATE : 3
BILLSEQ : 1
BILLVERSION : 1
ACCCURRENCYCODE : GBP
BILLLANGID : 1
BILLLANGNAME : English
BILLLANGLOCALE : en_GB
we have to seperate the field and values and generate the xml.
pls anybody help me in this problem.
Thanks&Regards
RENU
Thanks&Regards
RENU
|
|
|
|
|
Looks to me like each line only has a space between the key and the value, so use the Split method on the string class to turn them into an array of key and value, line by line.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi Graus
Thank you for ur valuable suggession.but im new learner in .net.
pls can u send me some sample code for this .
Thanks&Regards
RENU
|
|
|
|
|
DON345 wrote: but im new learner in .net.
pls can u send me some sample code for this
I don't understand, you're obviously writing code professionally, but you're new to .net ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
store everything in a string
for eg: string str=data;
string[] temp = new string[1000];
temp = str.Split('\n'); //now wat this will do is,each line is stored in each array
for eg: temp[0] will have "GENEVAVERSION 5.0"
temp[1] will have "BILLSTYLE 2" and so on
and wat u have to do is that, take a for loop and parse til the end of the temp array and use one more split function and finally store that in XML
did this help.......
|
|
|
|
|
Hi Rahul,
yes you are given correct approach but i shown you before it is sample code.
if i have bulk amount of data,is this string is able to store that whole data.
Thanks&Regards
RENU
|
|
|
|
|
If it has got lots of data then u can go for StringBuilder.
|
|
|
|
|
Hi rahul
actually iam new at .net,i dont know how to parse field value text data into xml.could you help me in this scenario.
Thanks&Regards
RENU
|
|
|
|
|
I have a client-server application. When I try to connect to the server application using the loopback address, it runs fine, but if I give the actual IP or if I try to connect a server that run on another machine, it throws,
System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it
excpetion. Has it got something to do with .net security settings that we have in Adminstrative tools in the control panel? I've just set the local intranet security to "full trust". Any help?
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir?
Dr.Brad :Well,I just replied to everything Graus did and then argued with Negus for a bit.
|
|
|
|
|
do u have any kind of firewall installed in your system or in the other system. If there is, then disable it and try.
If this doesnt help , then come back with the code
|
|
|
|
|
I guess it's not something related to the firewall, Because I just tested it with my C++ C/S application with the same port. It works fine. Btw, I just reached home. Dont have the code with me now. But it's quite simple.
It's quite primitive one, A simple TCP listener waiting to accept a TCP client. with 127.0.0.1, everything works cool.
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir?
Dr.Brad :Well,I just replied to everything Graus did and then argued with Negus for a bit.
|
|
|
|
|
That is true for 127.0.0.1, what port number do you use, in .NET you must use a port number that is greater than 5001 (As I remember).
|
|
|
|
|
I gues it's not for .net in particular, but in general it's safe not to clash with the reserved zones.I'm in the safest of zone. Above 20000!. I'm using 20555. And no other application uses this port in my pc.
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir?
Dr.Brad :Well,I just replied to everything Graus did and then argued with Negus for a bit.
|
|
|
|
|
That's what came to my mind, though I'm not experienced with network programming.
|
|
|
|
|
Actually i have data like in this format:
1aDOCSTART_3
DOCTYPE BILL
GENEVAVERSION 5.0
BILLSTYLE 2
BILLTYPE 1
BILLTEMPLATE 3
BILLSEQ 1
BILLVERSION 1
ACCCURRENCYCODE GBP
BILLLANGID 1
BILLLANGNAME English (UK)
BILLLANGLOCALE en_GB
Our requirement is to parse this file into xml format like attribute value pairs. like:
<1aDOCSTART_3>
<genevaversion>"5.0"
<billstyle>"2"
<billtype>"1"
<billtemplate>"3"
<billseq>"1"
<billversion>"1"
<acccurrencycode>"GBP"
<billlangid>"1"
<billlangname>"English (UK)"
<billlanglocale>"en_GB"
we have to seperate the field and values and generate the xml.
pls anybody help me in this problem.
Thanks&Regards
RENU
|
|
|
|
|
hi all,
i worked in ASP.Net and there i have default 6validators,
and i am happy to work with those,
and now when i wanna Restrict my controls, i didn't found any default validator property
please suggest me the approch, to validate textbox(for now)
thnx in advance
Prashanth
|
|
|
|
|
Hi all!
I need help ragarding the k-mean clustering algo. Any one have a
source code in C#.. or a dll file that could be used in the
project.... I cannot seem to identify the objects that could be used
in the algo..
I have to group the hospitals, and plot them in
graph, and then identify the number of patients in the region.
Urgently need help!
|
|
|
|
|
You think that u r brilliant but that’s not truth
|
|
|
|
|
Do you think that spamming is brilliant?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
He is brilliant. But I think he was a harsh with you though.
--------------------------------------------------
|
|
|
|
|
You think we care, but we don't.
(This is directed at Mr BigShot)
Brad
Australian
- Bradml on "MVP Status"
If this was posted in a programming board please rate my answer
|
|
|
|
|
Since the OP's message was removed I don't get to see what all the extra fuss was about above and beyond the spamming aspect. I presume he made some derogatory remark towards Christian Graus.
|
|
|
|
|
Yeah, I'm curious as to what he said, too!
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|