acat: show text files Usage: acat {file1} {file_n...} [options] files: usually text files to put onto the std out (the following properties are shown before the actual line content) Parameters: -line: show the number of lines (within the file) -total: show the accumulated number of lines (that of the whole output) -lw {width}: field width of the line numbers -file: show the file name -r {s1} {s2}: replace the string s1 with s2 in each line (also repeatedly) -root {dir}: root directory for the file names -sep {char}: use {char} as separator between line#/filename/line -f[ormat] {format_str}: format the output with variables in $(variable) form available variables: - CONTENT, INPUT: the line of the file - FILE: full file name - FILENAME: file name witout path - PATH: file path - EXT: file extension - LINE: line number within the file - SUM_LINE, TOTAL_LINE: the number of the output line -filename/-fn: show the file names in front of the listed text of the given file. The variable is FILENAME. This can be useful in case of several files being listed and the results are appended - the contents will be able to be identified by the file names. -filename_format/-fnf {format_str}: specify the formatting for the file names prepending the file contents -show_parallel/-sp: show the lines of the text files in the same line, respectively. The first output line will contain the first lines of the files, the second line the next lines and so on. These parameters can be used to create tables of file contents, where the the lines of the files are arranged into the columns of the tables. -psep {str}: specify the separator for the lines of the parallely listed files. The default value is '|'. -pf {format_str}: specify the format for the parallel show. The FILE[n] variables refer to the line of the appropriate file. The LINE, SUM_LINE, TOTAL_LINE variables all work as above. -parallel_align/-pa: in case several files are listed parallelly (in columns next to each other), we can ensure that the column items in the lines are always of the same width -ppad {pad_char}: specify the character that is used to fill the empty space when the column contents are aliged -pr: the default parallel alignment is left, this switcdes it to right -nl: always write a newline character at the end of the files -pre {text}: write the given text before the actual content of the file. The string can be formatted, with the following variables: FILE, PATH, FILENAME, EXT -post {text}: similarly to the -pre, the given text is written after the lines of the file Windows only: -clipboard/-cb: write the current contents of the clipboard (paste to the console) Examples: acat test.txt -file -line -> show the lines like 'test.txt:12:twelth line' acat test.txt -f '$(CONTENT)' -> equivalent to the normal output acat test.txt -f '$(FILE) - $(SUM_LINE) *** $(CONTENT) <- end of line' -> 'test.txt - 123 *** many lines <- end of line' acat test.txt -fn -fnf '--- $(FILENAME) ---' -> the text listing will start with '--- test.txt ---' acat test1.txt test2.txt -sp -psep ';' -> list the file lines separated with semicolons, like: one;apple two;plum ... acat test1.txt test2.txt -sp -pf '$(TOTAL_LINE): $(FILE2) --- $(FILE1)' -> list the files using the given format: line number, line contents in reversed order For the following examples let's assume that we have two text files. fuits1.txt contains: apple plum strawberry grape fruits2.txt contains: raspberry gooseberry banana almond blueberry hale berry acat fruits1.txt fruits2.txt -sp -> apple|raspberry plum|gooseberry strawberry|banana grape|almond |blueberry |halle berry The missing lines in fruits1.txt generate empty strings in the result. acat fruits1.txt fruits2.txt -sp -palign -> apple |raspberry plum |gooseberry strawberry|banana grape |almond |blueberry |halle berry