Thanks for the update to mark the code. Can you do the same with the input and output? If there are multiple spaces, these get compressed when displayed as normal text - and that might be important.
For your inner loop reading
file2.txt where do you plan to use the value read in as
rep_line It's not anywhere else in your script.
I'm also unclear with the
if.....then....break.....fi section and what is actually required here. Are you simply looking to not complete the remaining
if...then.... sections? There are better ways to code that.
Can you write your logic out in words like this:-
- For every line in file1.txt
- Read every line in file2.txt
- Compare them so that
- if condition A matches I take action A
- if condition B matches I take action A
- if condition C matches I take action C
- or I do action D
- I write the output built from the input lines in format F
- End loop
- End loop
To get the bullet list, write your text first, then highlight the block and press the bullet list button. Having lists within lists produces the indentation to make it easier to read.
Thanks,
Robin