Append specific text in the start & end

I am trying to add specific text in the start & at the end of all lines of result files.

Any help please.

"MyTextStart " & (concatenation "%0d%0a" of (pathnames of files whose (name of it contains ".txt" AND name of it does not contain "XYZ") of folder "C:\Windows\Temp")) & " My Text End"

In results its only adding my text in the starting of 1st of result & with last line of results at the end. all pathnames in between there are 50+ files those are missing it.

move your concatenation to the outside.
concatenation "%0d%0a" of ("START" & it & "END") of (pathnames of files whose (name of it contains ".txt" AND name of it does not contain "XYZ") of folder "C:\Windows\Temp")

3 Likes

Thanks @brolly33 ! :slight_smile:

1 Like