Difference: CSC121F2023Lab08Hint3 ( vs. 1)

Revision 12023-06-20 - cathybareiss

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="CSC121F2023Lab08"

Hints to copy a file

  • The basic idea:
    • open one file for reading and the other for writing
    • while not at the end of file of the input file
      • read the current line from the input file
      • write it to the output file
    • close both files
  • To change a given line
    • add a counter to your loop
    • if it is not the line you want, continue as normal
    • if it is the line you want, write the change (but don't forget to count this line).
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback