Я хочу транспонировать таблицу (чередовать строки в столбцы и наоборот). Как это сделать в iWork Numbers.
2 ответа
5
Я написал простой AppleScript, который делает это.
tell application "Numbers"
    activate
    tell the front document
        tell the first sheet
            set original_range to selection range of first table
            set orignal_table to first table
            set number_of_columns to column count of orignal_table
            set number_of_rows to row count of orignal_table
            set trasposed_table to make new table with properties {row count:number_of_columns, column count:number_of_rows}
            repeat with i from 1 to number_of_columns
                repeat with j from 1 to number_of_rows
                    tell orignal_table
                        set original_value to the value of cell i of row j
                    end tell
                    tell trasposed_table
                        set the value of cell j of row i to original_value
                    end tell
                end repeat
            end repeat
        end tell
    end tell
end tell
Здесь вы можете найти более подробную информацию об этом.
2
Те, кто использует последнюю версию Numbers, могут использовать параметр "Транспонировать строки и столбцы" в меню "Таблица", как показано в этом ответе на StackExchange. Изображение ниже также бесстыдно "заимствовано" из этого ответа, для удобства.

