Solved

Carrige return check!

Posted on 1997-09-05
3
185 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
This article is in regards to the Cisco QSFP-4SFP10G-CU1M cables, which are designed to uplink/downlink 40GB ports to 10GB SFP ports. I recently experienced this and found very little configuration documentation on how these are supposed to be confi…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

628 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