I have a directory (Confidential) which contains a bunch of text files.
Confidential
:- Secret-file1.txt
:- Secret-file2.txt
:- Secret-file3.txt
I want to produced another textfile (Summary.txt) with textwidth, say, 80 and with following formating
Secret-file1 - This file describes various secret activities of
organization Secret-Organization-1
Secret-file2 - This file describes various secret activities of
organization Secret-Organization-2. This summarizes
their activities from year 2001.
Secret-file3 - This file describes various secret activities of
organization Secret-Organization-3. This summarizes
their activities from year 2024.
Where the second column is right-aligned and copied from first line of corresponding text file. For example, the "Secret-file1.txt" looks like this
This file describes various secret activities of organization Secret-Organization-1.
XXXXXXXXXXXXXXXXX BUNCH of TEXT TILL EOF XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
How can I do that? I am looking at various options at bash (e.g., sed, awk,grep, your-prefered-bash-built-in).
Thanks
A
headorsed) and then format that ready for indentation (fmt? it is not clear there's a standard word-wrapper), then arrange to process each of the formatted outputs so the first line is preceded by the file name and dash, and the remainder by a corresponding number of spaces.