by Ulrich Windl <Ulrich.Windl@[EMAIL PROTECTED]
>
Nov 7, 2007 at 09:35 AM
Roman Töngi <roman.toengi@[EMAIL PROTECTED]
> writes:
> I want to change a file consisting of customer records.
> Every line is finished by a return; so I think the file
> should be formated properly.
>
> I read every line one after the other, rewriting the lines
> without the first seven characters.
Actually, I'd use one of the existing UNIX utilities like "cut -c7-" or
"sed -e 's/^.......//'".
>
> The first line is read correctly, but remains unchanged.
> Furthermore, file.next_line does not move to the next line but
> to a arbitrary position.
>
> What is wrong with the code? Thanks for any help.
>
>
>
> class
> APPLICATION
> create
> make
> feature -- Initialization
> make is
> -- Run application.
> local
> file: PLAIN_TEXT_FILE
> text_line: STRING
> do
> create file.make_open_read_write ("kunden.tab")
> if file.exists then
> if file.readable and file.writable then
> from
> file.start
> until
> file.end_of_file
> loop
> file.read_line
> text_line := file.last_string.substring (7,
file.last_string.count)
> file.put_string (text_line)
> file.next_line
> end
> end
> file.close
> end
> end
> end -- class APPLICATION