Starting with the basics, I have a file that has a number, one or more spaces then a filename (including path). The filename and path could contain spaces as well. I want to use awk to separate and use the components in further tests on equality between those fields in separate files. Dealing with only the first problem, this is the file:111  aaa/aaa222  b b/bbb333  ccc/c c444  d d/d dI would like to see as the output: aaa/aaa 111b b/bbb 222ccc/c c 222d d/d d 222The essence here is not the format of the above output but rather being able to use $1, $2 and $3 further in the awk expression after these variables have been set. Although here it is just one file, I am really comparing two sets of files, but need to get my head around this component first.$1 should contain the alphanumeric sequence at the start of the line, $2 should contain the whole path (without the filename), and $3 should contain just the filenameI have tried changing the FS during the program, but it's just not happening for me:$ awk 'BEGIN{OFS= || }{FS= ;a[$1]=1;FS=/;b[$NF]=1;print $1, $2, $NF}' file1111 || dir1/a || aa222 dir1 || bbb || bbb333 dir1 || c cc || c cc444 dir1 || ddd || ddd555 dir2 || e ee || e ee666 dir2 || fff || fff999 dir2 || zzz || zzzNot only is the FS stripping the slash out, the the first variable is just wrong because it is only using the second FS
How to use multiple delimiters separately in awk
awk