Hi Michael,

Hi  all
I have a numbered text file with 1 to 800 lines, I need to replace text in specific lines with text from a field. I can replace by individual lines with the replace into a single line number, but how is this done with mutliple odd lines ?

replace 12345 with 67890 in the text file in all the listed odd individual line numbers.

example
67890-Dataname  < field "replace" contents

set the itemdelimiter to "-"
put item 1 of fld replace into lines 299,322,345,368,391,414,437,460,483,506 of field "textfile"

Looks like you need a nice repeat loop :-)

...
set the itemdelimiter to "-"
put item 1 of fld replace into text2replace
put fld "textfile" into tTextfile
## Doing everything in memory instead of manipulating the field directly will speed up things a LOT!
set itemdel to ","
repeat for each item i in "299,322,345,368,391,414,437,460,483,506"
   put text2replace into line i of tTextfile
end repeat
put tTextfile into fld "textfile"
...

Et voila!

Hope that helps.

Michael

Regards from germany

Klaus Major
[EMAIL PROTECTED]
http://www.major-k.de

_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to