ReadFile then WriteFile to Console without the line breaks,...

Hi,

well, this sound a little strange to ask such a "simple" question,
but i would like tho hear someone with a good recommendation
on this. I integrated  a little "dum file content as hex" into my console
application but whever the console output finds a line break it does
what a line break is meant to do: goes to teh next line. But how do i
i have two columns(10:10): One for the Hex Data and the other for
the plain file content. You can imagine what happens, when the console
reaches a line break inside a file a prints it out to the std output, which
the breaks the line too. How do i stop this, but will still be able to 
display
the "Line Break" on the right column while i have the hex data on the
right colum. See here for yourself:

http://entwicklung.junetz.de/pics/lf.jpg

I mean i can filter them and replace them with "blanks"
still make the hex code at the eft available, but maybe
there is a much easier or more reliable solution for this,...

How do i master this?

Regards

Kerem



-- 
----------------------- 
Beste Gr�sse / Best regards / Votre bien devoue
Kerem G�mr�kc�
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
----------------------- 
"This reply is provided as is, without warranty express or implied." 


0
kareem114 (144)
1/13/2008 4:42:12 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
620 Views

Similar Articles

[PageSpeed] 50

Well, you are thinking of lines as having meaning, and they don't.

CString OutputLine;
CString sep;
for(int i = 0; i < n; i++)
    { /* format line */
     if(i % ITEMS_PER_LINE == 0)
        { /* new line */
         if(i > 0)
            { /* put out chars */
             OutputLine += _T("|  |");
             char t[2]; // 8-bit characters
             for(int ii = i - ITEMS_PER_LINE; ii < i; ii++)
                 { /* char version */
                  t[0] = data[i];
                  t[1] = '\0';
                  if(!_isprint(t[0]))
                     t[0] = '.';
                  OutputLine += CString(t); // makes Unicode if necessary
                 } /* char version */
              OutputLine += _T("|\n");
              _tprintf(OutputLine);
             } /* put out chars */
          OutputLine.Format(_T("%08x  |"), i);
          sep = _T("");
         } /* new line */
     CString s;
     s.Format(_T("%s%02x"), sep, (BYTE)data[i]);
     sep = _T(" ");
     OutputLine += s;
   } /* format line */

// Deal with the leftover part of the line (left as an exercise for the reader)

Note that if there is a newline in the text, nothing unusual happens.
				joe

         
On Sun, 13 Jan 2008 17:42:12 +0100, "Kerem G�mr�kc�" <kareem114@hotmail.com> wrote:

>Hi,
>
>well, this sound a little strange to ask such a "simple" question,
>but i would like tho hear someone with a good recommendation
>on this. I integrated  a little "dum file content as hex" into my console
>application but whever the console output finds a line break it does
>what a line break is meant to do: goes to teh next line. But how do i
>i have two columns(10:10): One for the Hex Data and the other for
>the plain file content. You can imagine what happens, when the console
>reaches a line break inside a file a prints it out to the std output, which
>the breaks the line too. How do i stop this, but will still be able to 
>display
>the "Line Break" on the right column while i have the hex data on the
>right colum. See here for yourself:
>
>http://entwicklung.junetz.de/pics/lf.jpg
>
>I mean i can filter them and replace them with "blanks"
>still make the hex code at the eft available, but maybe
>there is a much easier or more reliable solution for this,...
>
>How do i master this?
>
>Regards
>
>Kerem
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
1/23/2008 5:49:57 AM
Hi Joseph,

thank you very much for your example, i solved it already
with c-runtime functions. Thanks very much, i really
appreciate that!

Regards

Kerem
P.S: HNY 2008, by the way,...

-- 
----------------------- 
Beste Gr�sse / Best regards / Votre bien devoue
Kerem G�mr�kc�
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
----------------------- 
"This reply is provided as is, without warranty express or implied." 


0
kareem114 (144)
1/23/2008 10:39:59 AM
Reply:

Similar Artilces:

Consolication of data
Anyone have a quick way of taking a set of data (x value of time) tha is presented in 10-minute bins (data point every 10-minutes) an consolidate to 30-minute binned data sets (essentially sum every 10-minute bins to each 30-minute bin). Thanks. Mik -- Message posted from http://www.ExcelForum.com My data actually starts in B9, does that changes how things are done i the formula? Mik -- Message posted from http://www.ExcelForum.com My data actually starts in B9, does that changes how things are done i the formula? Mik -- Message posted from http://www.ExcelForum.com Hi Mike Using...

how can i transfer data from one sheet to another without blank li
Dear All I have extracted data from a system to a sheet including blank lines between the data. Any idea of how i can transfer the data from one sheet to another without any blank lines, in order to do my job using excel functions? Thanks in advance If you mean blank rows why dont you just sort the data? In case you need to retain the order (you can use a temporary column); insert an additional column say A. Number 1,2,....till the end in cells a1,a2 ...... Sort col B. Delete the blank rows..and then sort by ColA...Remove ColA -- Jacob (MVP - Excel) "Manos&q...

Outlook Service don't run. but the code runs fine in a console app
HI I am working on an application that searches other peoples calendar and saves the data for later use. I wrote the application as a console application and it works just fine. but now I have converted it into a windows service. it builds and installs fine but it don't seem to run. when I debug my service it never get to the tick event from the timer any ideas :) ? Greetings "entvex" <entvex@gmail.com> wrote in message news:94211f49-8759-4eb5-b47a-dbae83ec36e4@e18g2000vbe.googlegroups.com... > I wrote the application as a console application and it works just &g...

Dismount store command line help
I'm working on a batch file to run eseutil on one of my information stores. I can't find the command line to dismount and remount a particular information store. Thanks for the clue! Fred Try this: http://hellomate.typepad.com/exchange/2003/12/command_line_st.html -- Neil Hobson Exchange MVP For Exchange news, links and tips, check: http://www.msexchangeblog.com "Fred" <fredt2@mail.com> wrote in message news:7rY9d.219029$D%.208827@attbi_s51... > I'm working on a batch file to run eseutil on one of my information stores. > I can't find the comm...

How do i show the gap between two lines of a chart
Very simple question. I have a two line graph that I made in Excel. I want to shade just the area between the two lines wherever they diverge. Does anyone know how to do that? Hi, The trick is to use area charts to provide the shading. This requires adding additional series. See this example. http://www.andypope.info/ngs/ng21.htm Cheers Andy beuchner wrote: > Very simple question. I have a two line graph that I made in Excel. I want > to shade just the area between the two lines wherever they diverge. Does > anyone know how to do that? -- Andy Pope, Microsoft MVP - E...

break XY data to series
Hi I have a problam creating an XY chart in excel 2007 for each point (x,y) is in a certain group and i want to create a chart that color each point according to it's group. I tried to put each group in a diffrent series, but I only managed to do so manually, since I have nearly a hundred groups it's not so practical. my data is somthing like: X Y G 1 1 1 2 1 1 3 2 2 4 1 2 5 19 3 and so on. Here's how to break it up: http://peltiertech.com/Excel/Charts/ConditionalChart1.html Put your G values into the header cells t...

Long message line
How do I put message on a MsgBox in multiline. e.g. "1. xxxxxx" "2. yyyyyy" "3. zzzzz" Secondly, if the message writing itself in line 1 is long in code, how to break the line/sentence so that it is displayed (else one has to scroll on right side). (I remember seeing in some example, the character _ used; but do not know fully) e.g. I want to write as "1. xxxxxxxxx ssssssssss _ kkkkkkkkkkkk bbbbbbbbb. Please suggest. --- Message posted from http://www.ExcelForum.com/ Hi try something like the following dim msgstr as string msgstr = "line1" ...

Compress excel without using additional software
Hi, Is it possible to compress Excel without installing any additional software or writing any programs? Thanks for your help! ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ "nylecaj" <nylecaj.v2iyi@excelforum-nospam.com> wrote... >Is it possible to compress Excel without installing any additional >software or writing any programs? The compression capabilities built into NTFS file systems are adequate for your needs? Direct answer: no. ...

Can I reply without including senders message?
Is there anyway that when I reply or reply to all I can reply with just the message that I type and not include the message that I'm replying to? I know I can delete it but I do it a lot and just want to know if there's a shortcut. Any help would be greatfully appreciated. Cheers Jamie Yes - Go into "options" then "preferences" then "email options" At the bottom half of the page under "on replies & forwards" you have the option there as to whether to include the original email in the reply. >-----Original Message----- >Is th...

Calling ReadFile after DeviceIOControl (Unexpected Results)
Hi folks, I'm using "LPT1" via CreateFile for Overlapped communications. I use WaitSingleObject and then GetOverlapped Result to collect ReadFile results. All that code, including overlapped WriteFile's work great and have been for years. However, now I need to get the BUSY state of the port. It appears the only way to do this in the context of Win32 is via: DeviceIOControl(Handle, IOCTL_PAR_QUERY_INFORMATION, Nil, 0, @status, SizeOf(status), @OVERLAPPED); This call works great, repeated adnausem and yields the proper results every time, in realtime....

I want to find the lowest point on the plotted line in a graph.
Hi, I want to find the lowest point on the plotted line in XY (Scatter) graph. I have many points scattered above and below the line. I need the lowest point on the line and not the lowest point on the graph. Hi, We need more detail about the line and your data points? Is the line a simple horizontal line, a slope or a undulating line? Cheers Andy -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info "Edwin" <Edwin@discussions.microsoft.com> wrote in message news:1B9AF947-98BD-467F-9F23-93039DD968DC@microsoft.com... > Hi, > > I wa...

IWebBrowser2 without loading BHO
Hello, I have a MFC application using IWebBrowser2 control, I find that the application uses memory as much as 90MB, but when the application window is minimized, the memory usage reduces to 2MB, could you tell me how to make the application run with stable memory usage? If it is caused by BHO, Could you tell me how to prevent IWebBrowser from loading or using BHO in the application? Thanks a lot. Charlie Hoo =E5=86=99=E9=81=93=EF=BC=9A > Hello, > > I have a MFC application using IWebBrowser2 control, I find that the > application uses memory as much as 90MB, but when the...

Wordperfect Justification and Line Breaks
The WordPerfect line justification setting gets rid of Word's dreadful spacing with justification. However, I am finding many cases where Word incorrectly breaks lines with this setting enabled. For example, I am frequently finding lines that being with commas. Is there any way to correct this problem? I just don't understand what you have said about breaking: "For example, I am frequently finding lines that being with commas." What does that mean? FWIW, I use WP Justification all the time and never have any problem with it, not have I heard any other users ...

Copy without reference to original file
Hi all, I have a set of about 250spreadsheet files each contaning 4 individual sheets. I now need to add an additional sheet to each file which will contain cell references to cells on other sheets of that file. I intended to add the sheet and create the cell references in one of the files and simply copy that to the the added sheet in each of the other files, but when doing so I found that the reference to the file copied from was included in the cell reference in file I pasted to. Example - Copying from a file named first file and pasting to a file named second file results in a cell ...

"ERROR_INVALID_PARAMETER": ReadFile() and WriteFile()
I am writing a program that connects to a serial port and writes data. I follow the guides from MSDN and I use ReadFile() and WriteFile() to do data I/O. The port is opened in non-overlapped I/O mode. But whenever I call ReadFile() or WriteFile(), it returns error number 87, and when I look that up, it is the ERROR_INVALID_PARAMETER. So I made sure that everything was okay. The buffer I pass to those functions is actually allocated and okay, and the variables for how many bytes to read/write, and the lpdword for how bytes were actually read/written are okay as well. And the over...

Total lines to use for database ??
Am thinking of using Excel for a database but will it hold 10,000 line of data ??? 10,000 different data entries with name , address, city state, phone, etc ??? What's the total number I can put into excel 97 ??? Thanks..... -- Message posted from http://www.ExcelForum.com You can have 65,536 different data entries, using one row for each entry, and 256 different fields per entry. -- HTH, RD --------------------------------------------------------------------------- Please keep all correspondence within the NewsGroup, so all may benefit ! --------------------------------------...

Averaging without #DIV0!
I’m using a worksheet that has a cell (C27) that totals rooms and a cell (J28) that totals rates and a cell (J29) that is the average daily rate total, rate/total rooms. I’m using the formula =AVERAGE(J28/C27). The only problem is until I actually input a number into C27 I get the #DIV/0! displayed in my ADR cell (J29). I don’t always need this data so is there a way I can input the formula and not have the #DIV/0! in cell J29? Thanks, Malcolm G'day Malcolm =IF($J28=0,0,AVERAGE(J28/C27)) HTH Mark "Malcolm" <Malcolm@discussions.microsoft.com> wrot...

editing .pub files without publisher
Is there anyway to get a publisher created file to read on word or on a computer with out any office software? I was handed a publisher file that needs to be edited for a group of about 30 and only 3 of us have publisher. Some don't have any office programs at all. I need something simple so they can all add the own info to the Doc. and not many are very IT literate. You are asking the impossible. Have the three Publisher user's edit the document. The other folks can offer suggestions, even images. You don't need an Office product to share images or text, but you do need Pub...

Without attachments
I am trying to construct a message that lists the results of a query along with a standard message line. I could just send the results from the query as a report attachment, however, I am trying to avoid sending attachments. Does anyone know how to do this? Any help is surely appreciated The email would look similar to this: To: name Subject: results Body: Here is the results: <query results pasted here> Stacy, you will need to OpenRecordset, loop through the records, and concatenate the values into a string to use as the message text for SendObject. If you need an example o...

Quote product line should allow for negative extended amounts.
Quote product lines should allow for negative amounts. A situation where this is required is when dealing with bulk discounts. We want the ability to apply a product line with a negative value and have the overall quote value reflect this change. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agre...

Installing Money without access to updates (as Money is retiring)
Hi all I have a copy of Money 2006 (I think, the version isn't the point here). When I do a new install, I cannot open my existing .mny file. I first create a dummy file, wait for Money to mention it has updates to install, and then install them. Once this is done, I can open my existing file. My problem is this: Five years from now when Money is a distant memory, I may want to install it on a new computer. I fully intend to stick to my retirement plan in Money using Money, and so I see a long, long life for this product on my current and future computers. How, then, can...

incoming images appear as lines letters and numbers
Some incoming messages that include images have lines of text and numbers only. The entire message seems to have been changed. "Lost in San Diego" <LostinSanDiego@discussions.microsoft.com> wrote in message news:941ADCCC-4993-4523-A8FA-3483FC5DFA0E@microsoft.com... > Some incoming messages that include images have lines of text and numbers > only. The entire message seems to have been changed. The usualy cause of this is an add-in on your PC corrupting the incoming mail stream. The first thing to do is to uninstall your antivirus application and reinsta...

How can I change size of the picture without changing chartobject?
Hi there, I have this code in a userform and get with it a picture in the same size as the chartobject - to small. I want a much larger (fill the screen as much as possible). I can easily solve it by changing size of the chartobject before export to gif, but i dno't want to do that. I want to change the size of the gif during or after importing it by LoadPicture. How? Help = Forever happy /Regards Dim ChartNum As Integer Private Sub UserForm_Initialize() Debug.Print "frmPPT initilize " ChartNum = 1 UpdateChart End Sub Private Sub UpdateChart() Set CurrentChart ...

Access a query without opening Access
I have a db with several dozen queries. I need a non-technical person, who is also not authorized to see all the info in the db, to run one query each day. Is there any way to launch a query without being in the query view of Access? Or is there a way to have a single query in the query window whuch has sub queries not visible or in another location? On Fri, 8 Jan 2010 15:11:01 -0800, Tired and Confused <Tired and Confused@discussions.microsoft.com> wrote: >I have a db with several dozen queries. I need a non-technical person, who >is also not authorized to se...

Conditional formatting of line chart
Hi, Is it possible to change line chart so that when value is >100 color of the line is green and when the value is <100 color of the line is red? All help is highly appreciated!! Andy Pope has an example on his web site: http://www.andypope.info/charts/conditionalline.htm Jack77 wrote: > Hi, > > Is it possible to change line chart so that when value is > >>100 color of the line is green and when the value is <100 > > color of the line is red? > > All help is highly appreciated!! > > -- Debra Dalgleish Excel FAQ, Tips & Bo...