Select to view content in your preferred language

Adding Carriage Return for formatting purposes in ArcPro Table

968
3
Jump to solution
10-20-2023 12:16 PM
Confetti
New Contributor II

I need a table in a layout where each Value in the cell is proceeded by a carriage return. How is this accomplished? The current format in the final data frame is adjust by a python script using .agg(', '.join) to get the commas.

Instead of: 

    11 D3, 11 D4, 11 C3, 11 C4

I want:

    11 D3

    11 D4

    11 C3

    11 C4

By changing the column width, it adjusts the other columns as well and I do no want the others to be shortened. I am not against solutions in excel, but I don't see why this can't be handled in Pro. Thanks.

0 Kudos
1 Solution

Accepted Solutions
Confetti
New Contributor II

I'm unsure if I can include this in my original Notebook but .replace() worked as a Python 3 expression in the field calculator. Consider this case closed!

View solution in original post

0 Kudos
3 Replies
Luke_Pinner
MVP Regular Contributor

Have you tried inserting a newline .agg('\n'.join) instead of a comma? If that doesn't work, you may need to reduce the column width and enable word wrapping.

0 Kudos
Confetti
New Contributor II

I have tried this. The result is adding \n as a string so that I get 11 D3\n11 D4\n11 C3\n11 C4. The issue with shortening the columns is that I cannot individually shorten the one column, it would shorten the other column as well which would not be desired. Also because of the variance in 1-2 character 'words' separated by spaces, it would be almost impossible for them to all start a new line at the correct character.

0 Kudos
Confetti
New Contributor II

I'm unsure if I can include this in my original Notebook but .replace() worked as a Python 3 expression in the field calculator. Consider this case closed!

0 Kudos