Adding newline to Custom Report for csv output

I have a relevance statement that returns several fields separated by commas. I am trying to schedule a report based on this relevance to be archived. I select csv as the format for archiving these files. When I go to save any of these files as a csv, and then open with Excel, I get one long line of text.
I was expecting each “row” to be on a separate line.
When I use the Presentation Debugged and say to Evaluate as string, I get a separate line for each “row”.
Is there something I can add to the relevance code to add a new line after (or before) each line so that it will appear correctly when I open the csv file in Excel?

Thanks,
BobK

You need to concatenate the output into a single string with newline characters.

concatenations "%0d%0a" of ...

Here is relevance that I’m working with. I tried to convert each line of output to a string, using & “,” & in place of , but I had a problem replacing the comma after
"id of action of it" with a & “,” &

Also, I can add a & “,” & at the end of the “state of” lines, but I can’t add it after the subsequent “fields”

(
        (
                id of action of it,
                name of action of it,
                name of issuer of action of it,
                (
        (
                month of it as two digits & "/" &
                day_of_month of it as two digits & "/" &
                year of it as string
        ) of date (universal time zone) of it
        & " " &
        (
                two digit hour of it as string & ":" &
                two digit minute of it as string & ":" &
                two digit second of it as string & " " &
                universal time zone as string
        ) of time (universal time zone) of it
) of time issued of action of it,
                state of action of it,
                status of it as string, 
                (name of site of it & "/" & name of it) of source fixlets of action of it,
                (
                        (name of computer of it | "n/a"),
                        ((
        (
                month of it as two digits & "/" &
                day_of_month of it as two digits & "/" &
                year of it as string
        ) of date (universal time zone) of it
        & " " &
        (
                two digit hour of it as string & ":" &
                two digit minute of it as string & ":" &
                two digit second of it as string & " " &
                universal time zone as string 
        ) of time (universal time zone) of it
) of last report time of computer of it)
                ) 
        ) of results of bes actions whose (
                (now - time issued of it) < 1*day
         and 
                (exists name of site of source fixlet of it)
        )
);(
        (
                id of it,
                name of it,
                name of issuer of it,
                (
        (
                month of it as two digits & "/" &
                day_of_month of it as two digits & "/" &
                year of it as string
        ) of date (universal time zone) of it
        & " " &
        (
                two digit hour of it as string & ":" &
                two digit minute of it as string & ":" &
                two digit second of it as string & " " &
                universal time zone as string
        ) of time (universal time zone) of it
) of time issued of it,
                state of it,
                "not reported",
                (name of site of it & "/" & name of it) of source fixlets of it,
                (
                        (
                                (name of it | "n/a"),
                                ((
        (
                month of it as two digits & "/" &
                day_of_month of it as two digits & "/" &
                year of it as string
        ) of date (universal time zone) of it
        & " " &
        (
                two digit hour of it as string & ":" &
                two digit minute of it as string & ":" &
                two digit second of it as string & " " &
                universal time zone as string
        ) of time (universal time zone) of it
) of last report time of it as string | "n/a")
                        ) of elements of (set of targeted computers of it - set of computers of results of it)
                )
        ) of bes actions whose (
                (now - time issued of it) < 1*day
         and 
                (exists name of site of source fixlet of it)
        )
)

Thanks,
BobK

They probably need to be converted into strings:

... & "," & ( (it as string) of id of action of it ) & "," & ...
1 Like

Here is what I was able to add the relevance without getting any errors (I used -----> in front of line to show lines I wasn’t able to modify):

(
        (
                ( (it as string) of id of action of it) & "," &
                name of action of it & "," &
                name of issuer of action of it & "," &
                (
        (
                month of it as two digits & "/" &
                day_of_month of it as two digits & "/" &
                year of it as string
        ) of date (universal time zone) of it
        & " " &
        (
                two digit hour of it as string & ":" &
                two digit minute of it as string & ":" &
                two digit second of it as string & " " &
                universal time zone as string
        ) of time (universal time zone) of it
) of time issued of action of it,
                state of action of it & "," &
         -----> status of it as string,
         -----> (name of site of it & "/" & name of it) of source fixlets of action of it,
                (
                        (name of computer of it | "n/a") & "," &
                        ((
        (
                month of it as two digits & "/" &
                day_of_month of it as two digits & "/" &
                year of it as string
        ) of date (universal time zone) of it
        & " " &
        (
                two digit hour of it as string & ":" &
                two digit minute of it as string & ":" &
                two digit second of it as string & " " &
                universal time zone as string
        ) of time (universal time zone) of it
) of last report time of computer of it)
                )
        ) of results of bes actions whose (
                (now - time issued of it) < 1*day
         and 
                (exists name of site of source fixlet of it)
        )
);(
        (
                ( (it as string) of id of it) & "," &
                name of it & "," &
                name of issuer of it & "," &
                (
        (
                month of it as two digits & "/" &
                day_of_month of it as two digits & "/" &
                year of it as string
        ) of date (universal time zone) of it
        & " " &
        (
                two digit hour of it as string & ":" &
                two digit minute of it as string & ":" &
                two digit second of it as string & " " &
                universal time zone as string
        ) of time (universal time zone) of it
) of time issued of it,
                state of it & "," &
         -----> "not reported",
         -----> (name of site of it & "/" & name of it) of source fixlets of it,
                (
                        (
                                (name of it | "n/a") & "," &
                                ((
        (
                month of it as two digits & "/" &
                day_of_month of it as two digits & "/" &
                year of it as string
        ) of date (universal time zone) of it
        & " " &
        (
                two digit hour of it as string & ":" &
                two digit minute of it as string & ":" &
                two digit second of it as string & " " &
                universal time zone as string
        ) of time (universal time zone) of it
) of last report time of it as string | "n/a")
                        ) of elements of (set of targeted computers of it - set of computers of results of it)
                )
        ) of bes actions whose (
                (now - time issued of it) < 1*day
         and 
                (exists name of site of source fixlet of it)
        )
)

If I tried to add the & “,” & to the lines with ----->, I received the error:

Error: A singular expression is required.

Getting closer…

Thanks,
BobK

add:

concatenation "" of ...

like:

… & ", " & concatenation “” of ( (it as string) of … ) & “,” & …