In simple words "modifying a text line"

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
cryptid
Newbie
Posts: 9
Joined: Thu Aug 18, 2005 2:57 am
Contact:

In simple words "modifying a text line"

Post by cryptid »

ok my earlier post did not return any results so i am posting question again in a more simple manner

Want to Make a program that will read a Text file and will add few words in the begging of the lines in the text file as well as in the ending of the line

Say the text file "file.txt" has the line
=====file.txt======
hi i need help
please help me
===============
the program should read this file and change it to

=====file.txt======
abc hi i need help def
abc please help me def
===============

so how can this be done please help
Z!re
Veteran
Posts: 887
Joined: Wed Aug 04, 2004 11:15 am

Post by Z!re »

[Pseudo code]
open file 1 for input
open file 2 for output

do
read line from file 1
line = "abc" + line + "def"

print line to file 2

loop until end of file 1
close both files

remove file 1

rename file 2 to file 1
[/pseudo code]
What part of the program dont you understand?
Is it a command you're looking for?
Is this homework?
What have you done so far?
I have left this dump.
Post Reply