I need to write into multiple files in a Do loop.
Hence, I tried to open multiple streams:
Do[ Symbol[StringJoin["S", ToString[i]] ] =
OpenAppend[StringJoin["sf", ToString[i]],
FormatType -> OutputForm ], {i, 1, 10}]
But this gives errors like:
Set::write: Tag Symbol in Symbol[S1] is Protected. Set::write: Tag Symbol in Symbol[S2] is Protected.
What is the correct way to name the indexed output streams in a Do loop ?

Attributes[Set], it includesHoldFirst, so the left hand side of=(Set) is held. – rhermans Jun 21 '18 at 13:42Subscriptwhile defining symbols (variables).Subscript[x, 1]is not a symbol, but a composite expression whereSubscriptis an operator without built-in meaning. You expect to do $x_1=2$ but you are actually doingSet[Subscript[x, 1], 2]which is to assign a Downvalue to the opratorSubscriptand not an Ownvalue to an indexedxas you may intend. Read how to properly define indexed variables here – rhermans Jun 21 '18 at 13:56