|
Why can't you ?
There's no other way I can see, unless you're sure there will never be quotes, then the space is a delimiter.
If you're unwilling to use a regex ( and if you don't know how, you should learn ), then you can always string mash your way to a solution, it's just nicer to do it properly.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
it will definetly have quotes bcoz its the input file name i should pass..
So it will definetly have quotes..say eg: "d:\c plus\some.h"..so this string should always be specified in quotes..
|
|
|
|
|
OK, then your choices are regex or string mashing ( that is, counting spaces and quotes manually in code )
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi,
I try to import a simple text file that have many rows with a special row format
Example: |item|123|any items|4.50|
When I read the lines in from the text file it removes the '|' tag.
Why is that??
Example Code:
StreamReader importFile = File.OpenText(txtPath.Text);
txtLines.Text = txtLines.Text + importFile.ReadLine();
I know I'm missing something simple.
Thanks for any help.
|
|
|
|
|
Perhaps | is a delimiter for the stream reader ? Is it reading the whole line every time, or up to the | ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I'm reading a whole line into a temp string and use the '|' tag to divide the string into column values.
When I read the whole string from the file the '|' tag is missing. So, I cannot divide the string up.
thanx
|
|
|
|
|
Hi all I am trying to convert code that being written in C++ to C# and I found that structure that using a property in C++ called "Bit Fields" and I didn't found it in C#, is there any way to convert it to C#
thx all
typedef struct _tagCPB {
unsigned short DialMode :1;
unsigned short LineToPBX :1;
unsigned short TriggerMode :1;
unsigned short DetectRoaringRemoteHangUp :1;
unsigned short DetectBusyRemoteHangUp :1;
unsigned short DetectRemoteHangUpWhenRecording :1;
unsigned short DetectRemoteHangUpAlways :1;
unsigned short StopOperationRemoteHangUp :1;
unsigned short MonitorDTMF :1;
unsigned short MonitorEnergy :1;
unsigned short DetectVoltReverseRemoteHangUp :1;
unsigned short DetectSilentWhenRecording :1;
unsigned short LearnPulse :1;
unsigned short MonitorPulse :1;
unsigned short MonitorTone :1;
unsigned short :1;
unsigned short OffHookDelay;
unsigned short OnHookDelay;
unsigned short FlashTime;
unsigned short PulseMake;
unsigned short PulseBreak;
unsigned short PulsePostDigitPause;
unsigned short ToneDuration;
unsigned short InterTonePause;
unsigned char OutsideLineAccess;
unsigned char RingsToAnswer;
unsigned short WaitAnswerDuration;
unsigned short InterDigitPause;
unsigned short NoSignalTimeOut;
unsigned short MaxSilence;
unsigned short MaxRoarDuration;
char PlayGain;
char RecordGain;
unsigned char PlayMode;
unsigned char RecordMode;
unsigned char OffThreshold;
} typeCPB;
|
|
|
|
|
|
Hi,
I am trying to fill a datatable with data for all records that have not been actioned. When they have been actioned a date is entered into the "actioned" field. Until it has been actioned, the field is empty.
How do I pass an empty/isNull parameter in the following:
this.correspondenceTableAdapter.FillBy(myclubDataSet.Correspondence, XXX );
where the XXX represents an empty DateTime field in the database.
Glen Harvy
|
|
|
|
|
DBNull.Value ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks for the prompt response but ..
this.correspondenceTableAdapter.FillBy(myclubDataSet.Correspondence, DBNull.Value);
results in:
Error16 Argument '2': cannot convert from 'System.DBNull' to 'System.DateTime?'
Glen Harvy
|
|
|
|
|
OK, you're using table adapters. I don't think there's such a thing as an empty DateTime, it has to have a value, and so you'd need to have your database table accept nulls for this column, in order to store a meaningful 'empty' date time value.
There is no such thing as DateTime.Empty.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I fixed it by amending the Select command in the tableadapter itself so that no parameter is passed at all.
Glen Harvy
|
|
|
|
|
Hi all
I am new to Visual Studio 2005 Windows Mobile development, please bear with me for some questions.
I have exe file installed in the device.
1.The Application launching very slow.When I double click the exe. file, I need to register to SIP Server,then load the Login form.its taking 4 to 5 sec for loading login-form.
2.Right now Iam connecting to internet thru GPRS before I launch the application.Is there any way to connect to internet on clicking Login -button?
3.I am trying to Exit the application many ways, but its not closing ,still running at the back-ground.
Please help me.
regards
|
|
|
|
|
We need to dynamically fetch text from the PNG files using C#.NET code. The application would load the image in memory and extract(return) the text out of it. We are aware that it is png specific ocr process. But I am unable to find a solution for it. The other requirement is that the solution for the above mentioned problem should not use any executables. Instead if it uses any COM dll, then the problem is rectified.
Thanks in advance,
Rgds
Amit
|
|
|
|
|
Is the text stored in metadata associated with the image, or in the actual image itself ? That is, can you see the text when you view the image ? If so, this is a pretty big task
Jatin Kakkar wrote: The other requirement is that the solution for the above mentioned problem should not use any executables. Instead if it uses any COM dll, then the problem is rectified.
So you're basically looking for an OCR library ? I believe Atalasoft has one for sale.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks Christian for a prompt reply. I am looking for some free source code(downloadable) for achieving the same. Buying a tool will take a lot more time to be approved. Any help in this direction will be highly appreciated.
|
|
|
|
|
OCR is never perfect. According to the google page someone linked you to:
It also doesn't do well on grayscale and color documents, and it's not nearly as accurate as some of the best commercial OCR packages out there. Yet, as far as we know, despite its shortcomings, Tesseract is far more accurate than any other Open Source OCR package out there
I take that to mean - good luck. If you need to use something free, then this is your best bet, perhaps you can turn the images to 1 bit first ? Anyhow, realistically, if you want any sort of guarentee, or any sort of support, you need to buy a library. You certainly don't want to be writing one.
Also, be aware that OCR performs very poorly when the text is not lined up exactly, or has background noise.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks again... As correctly mentioned by you that OCR-ing is not a perfect way of achieving the above mentioned task. Is there any other way out to extract the text from the PNG files. Buying a library seems to be the last resort for ur as the approval wfor the same would take a long time.
|
|
|
|
|
No, OCR is the only way. The text does not exist anymore, except as pixels that have no knowledge of their meaning to the human eye, so you need OCR to recognise them and pull them out.
Why would it take a long time ? Is this a commercial project ? If so, are your managers living in a fantasy ? OCR is a complex task, if they are being paid for this work, then a commercial library is the only choice that makes sense, unless you happen to get lucky with a free one.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks once again. The text which needs to be captured from the image file is actaully the part of the image (the text is visible in the image). I need to capture that text.
|
|
|
|
|
Google has a free OCR library, Tesseract[^]. Does that suit your requirements?
|
|
|
|
|
hello
I have bought the matlab building for .net.
in Matlab there is a Polyfit function who does
linear fitiing
how can I do a polyfit function in Cs?
|
|
|
|
|
Hi,
I have a page that has a list of wineries. If a winery is selected, then it displays a list of wine for that winery. No I can go an choose which one of the wine I want to add to the order.
Beneath the winery dropdown and wine selection, I have a gridview that displays all the order items.
Here is my confusion, when I add the wine as an order item to the OrderItems table, it works fine, but the gridview still displays the orderitems up to the last inesert. It's as if it does not refresh the gridview. I have to press F5 to have the news items added to display in the grid view.
Is there a way of refreshing the grisview when the items are added, because it does make a round trip to the server to insert the order items.
Please can some help. If there is confusion, please ask and I will try to explain better.
Regards,
ma se
|
|
|
|
|
Hi,
I have created windows service in c#. I would like to schedule windows service manually or by coding .How can I do this.
Any help is appreciated .
Regards,
Rajesh
rajesh
|
|
|
|