Solved

Carrige return check!

Posted on 1997-09-05
3
172 Views
Last Modified: 2010-04-16
Hi.

I need a program that opens a acsii file.
Check the first line at chr nr 80 if there is a carrige return, if not put inn one. If there is a CR at that posistion of the first line, just close the file.
If no then put inn a CR, go to the next line and do the same.
so on, until the end of file.

When i open the file i do not know how big the file is...

Best reguards, Kim Morgan Ellis
0
Comment
Question by:troll
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
kellyjj earned 50 total points
ID: 1215548
the way I would do it would   be like this:

while (not eof(file))  do
begin
   x=x+1  
   read(file, chr)
   if x=80  and chr<>char(13)  then  "put char(13) in file"
   if x=81  and chr<> char(13) then  x=1
   if x=81 and chr=char(13) then  break
end

This is kinda psuedo code, but for it should get you down the road.   Hope this helps
0
 

Author Comment

by:troll
ID: 1215549
Thank you very much, but I've never used Pascal, is this the whole Source code?... Please help me out..

Thx, Best reguards Kim Morgan Ellis
0
 
LVL 2

Expert Comment

by:kellyjj
ID: 1215550
Kim,  
The syntax is pretty much on.  though the "" is what you want to do, not actuall code.  Take this and place it in a program and it should work.  If you know c/c++ then you should have no prob picking up the syntax for pascal.  the two are very similar.

If you have any probs or questions then e mail me.  kellyj@r2d2.bpginc.com
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Tstream to hex 1 1,647
Extract text from webbrowser 5 1,373
using a list of objects, Delphi 3 594
Creating a blank copy of a TClientDataSet 1 1,135
Are you unable to connect or configure Hotmail email account in Microsoft Outlook 2010, 2007? Or Outlook.com emails are not downloading to Outlook? Lets’ see the problem and resolve Outlook Connector error syncing folder hierarchy (0x8004102A).
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now