FILE_TRANSPOSE
"Transpose" a File


FILE_TRANSPOSE is a FORTRAN90 program which creates a "transposed" copy of a file, in which, essentially, the I-th word of the J-th line becomes the J-th word of the I-th line.

Usage:

file_transpose input output
where

For example, if the input file is:

        Apple Ball    Carrot Doll
         Egg    Fig  1.23456,  Haystack
        Iodine 
               Joystick Kahlua Lompoc     Millipede Negatory
      
the transposed file will be:
        Apple Egg Iodine Joystick
        Ball Fig Kahlua
        Carrot 1.23456, Lompoc
        Doll Haystack Millipede
        Negatory
      

Licensing:

The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.

Languages:

FILE_TRANSPOSE is available in a FORTRAN90 version

Related Data and Programs:

CHRPAK, a FORTRAN90 library which can work with characters and strings.

CR2LF, a C++ program which reads a text file and replaces carriage returns by line feeds.

CRRM, a C++ program which reads a text file and removes the carriage return character.

DEBLANK, a C++ program which reads a text file and writes a copy which has no blank lines.

DECOMMENT, a C++ program which makes a copy of a text file which contains no "comment" lines (that begin with "#").

FILE_COLUMN_REVERSE, a FORTRAN90 program which creates a copy of a file in which the columns are reverse, that is, the characters on each line appear in reverse order.

FILE_MERGE, a FORTRAN90 program which merges two sorted files.

FILE_ROW_REVERSE, a FORTRAN90 program which makes a copy of a file in which the lines appear in reverse order.

FILUM, a FORTRAN90 library which can work with information in text files.

REFORMAT, a FORTRAN90 program which makes a copy of a file with a given number of "words" per line.

REWORD, a C++ program which reads a text file and writes a copy which has a fixed number of "words" per line.

TABLE_COLUMNS, a FORTRAN90 program which reads a TABLE file of N points in M dimensions and creates a new file by copying various columns, with repetition and shuffling;

TABLE_COLUMNS_PERMUTE, a FORTRAN90 program which reads a TABLE file where each line has M values, and permutes the columns according to the user's prescription;

UNCONTROL, a C++ program which makes a copy of a text file which contains no control characters.

WRAP, a C++ program which makes a copy of a text file in which no line is longer than a user-specified wrap length.

WRAP2, a C++ program which wraps long lines in a text file, but which wraps some lines "early", so as to avoid breaking words.

Source Code:

Examples and Tests:

PIGS is a simple demonstration of the program.

STORY suggests that the program is not so useful when working with ragged text.

MATRIX illustrates how a numeric table or matrix can be transposed. In fact, this is the application for which the FILE_TRANSPOSE program was written.

List of Routines:

You can go up one level to the FORTRAN90 source codes.


Last revised on 13 January 2012.