Solved

Carrige return check!

Posted on 1997-09-05
3
175 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
Each year, investment in cloud platforms grows more than 20% (https://www.immun.io/hubfs/Immunio_2016/Content/Marketing/Cloud-Security-Report-2016.pdf?submissionGuid=a8d80a00-6fee-4b85-81db-a4e28f681762) as an increasing number of companies begin to…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

776 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