|
I suppose he need filtering and sorting the file content.
Anyway this is going on my arrogant assumptions [...], since OP's question is rather ambiguos.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
See i have a log file.And this log file data is store like this.
Day/Date Student Name In/Out Time.
Thu Oct 6 14:43:16 2008 Abc 10
Thu Oct 1 14:43:17 2008 Abc1 10
Thu Oct 7 14:43:19 2008 Abc2 10
Thu Oct 9 14:43:21 2008 Abc3 10
Thu Oct 17 14:43:16 2008 Abc4 10
Now i want to sort these file according to Day/Date and store in new log file.
Sorted Data is
Day/Date Student Name In/Out Time.
Thu Oct 1 14:43:16 2008 Abc 10
Thu Oct 6 14:43:17 2008 Abc1 10
Thu Oct 7 14:43:19 2008 Abc2 10
Thu Oct 9 14:43:21 2008 Abc3 10
Thu Oct 17 14:43:16 2008 Abc4 10
Plz help me
|
|
|
|
|
You may use awk [^].
You may read one line at time and then use strtok to separate tokens, then add token values to your data structure, eventually perform filtering and sorting on the latter (array of).
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
lpVCcode wrote: in/out.Trim()
Interesting: what language does allow you the above?
BTW Since you're also writing the file, you may consider a different format, 'more machine-reading-friendly', this will simplify the parsing in order to filter & sort the info.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: Interesting: what language does allow you the above?
English allows it.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
I strongly doubt my English teacher would kindly accept the empty brackets...
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
The teacher may not, but the language allows the empty brackets and other funny things like... li..ke an OWL:
, _ ,
( o o )
/'` ' `'\
|'''''''|
|\\'''//|
"""
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Cheater! That's NOT allowed by the language, it is just allowed by Chris.
[military tone]
Sir, glorious day for the THHB!
[/military ton]
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: [military tone]
Sir, glorious day for the THHB!
[/military ton]
Yes, SIR..
Regards,
Sandip.
|
|
|
|
|
CPallini wrote: Interesting: what language does allow you the above?
My language. 
|
|
|
|
|
Persian?
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
no I invented an language of course thats code is of your site like previous. 
|
|
|
|
|
Why is it logged in a different order and then is again read separately and re-arranged? Why a two step process? This could prove very expensive for large number of log entries.
Can't it be logged in the desirable order at first?
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Depends on the file format.
Anyway, you've basically to read the file content, perform filtering and sorting on your structured data (in memory) and then (if you need) write back such info.
Bottom line: vague question, vague answer.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
Your question is transparent can you use of AlphaBlend for display your question.
|
|
|
|
|
Hi!
I have a Box with certain width and height. The box has to contain a certain text that should be visible inside the box no matter how long it is.
So, if the text is too small then it should take as much space in the box as possible. Its size should be inversly proportional to the text length. But I have to maintain its actual characters proportion too.
Any body who has ever done it in MFC. I am using VC 8
|
|
|
|
|
You should at first draw the text in a memory DC and than make StretchBlt to the wanted size. Read MFC class CDC.
Greetings from Germany
|
|
|
|
|
But how to draw text in the DC memory?
modified on Thursday, October 16, 2008 6:38 AM
|
|
|
|
|
CDC::DrawText()
Try considering to read the MSDN, or google "cdc and mfc".
Greetings from Germany
|
|
|
|
|
|
Is there any command that gets all the details of the device connected to the serial port ??
Actually i connect a smart card reader to a serial COM port, i send some data to it using WriteFile (), in return it gives some response, i read the response using ReadFile().
Now if i donot connect the reader and simply connect the serial cable to computers serial port i send the data to the handle of the serial port using WriteFile(), the computer(or ReadFile ()) waits infinitely for receiving response !
In order to solve above problem i use COMMTIMEOUTS, so if the specified time expires the ReadFile() executes successfully although it doesn't get the response!!
Actually i donot want to use COMMTIMEOUTS since i donot know the exact time in which the reader sends a response !!
if i use maximum delay it decreases the performance of my application, if i use completely less time delay, the ReadFile() expires even before it receives respone from the reader!!
so is there any other suggestion
|
|
|
|
|
kapardhi wrote: How to detect whether a device is connected to a Serial port (Re-Post,since not yet satisfied with given suggestions)
I think you'll have to re-post again and again. Good luck.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
For starters - check Wikipedia Serial Port
Here is the "link" with some extra characters added by this control:
<a href="http://en.wikipedia.org/wiki/Serial_port">http://en.wikipedia.org/wiki/Serial_port</a>[<a href="http://en.wikipedia.org/wiki/Serial_port" target="_blank" title="New Window">^</a>]
Your code needs to monitor the "handshake" signals of the serial communication protocol (RS232), i.e. hardware status, first before it attempts to read or write any actual data.
There is an older book dealing with serial communication in C, which covers this in details.
Sorry, don’t remember the exact title. Just Google it.
Cheers Vaclav
|
|
|
|