in reply to joining lines efficiency?
@TextArray = <TEXTFILE>;
The RegEx substitution you mention should work fine if it can handle a single string that long. I've never tried it that way, so I can't vouch for it.From what I've been doing, I'd suggest reading in the whole file, as you mentioned, and as indicated above. Then process each line in a foreach loop, copying lines into a separate array if they aren't the multi-line comments you don't want.
You would use a variable, perhaps $IsCommentLine, to start and stop the ommission of lines. Set the variable to true when the "/*" is found, set the variable to false when the "*/" is found. When the variable is false, copy the line into the separate array. When the variable is true, don't copy the line. Everything between the delimiters gets omitted, because the variable is true until the "*/" is found. Like your RegEx idea would do, but line-by-line instead.
|
|---|