You are not logged in.

#1 2026-11-21 13:20:18

Colonel Panic
Member
Registered: 2018-11-13
Posts: 1,880

Using awk to merge a set of text files,, including their contents

I'm trying to experiment with the awk command to do things that are very difficult and tedious to do manually.

First I moved to the subdirectory containing all my supp files, and then I typed this command in;

awk '{print $0,FILENAME}' supp*.txt > WhateverYouWant.txt

which produced a text file comprising all the contents of the supp files in that subdirectory, along with their filenames.

Links;

https://unix.stackexchange.com/question … -file-name

https://stackoverflow.com/questions/146 … nd-to-file

Last edited by Colonel Panic (2026-11-21 15:09:26)

Offline

Board footer

Powered by FluxBB