johnegracejr
Systems Engineer
I'm using awk to add the filename after the text on each line like this:
but the filename overwrites the original text starting at position zero.
The filename is "test.txt"
Example of text in the file:
Here is a long line of text
Expected output:
Here is a long line of text -- test.txt
But what I'm getting:
-- text.txtong line of text
I can add a a carriage return or newline carriage return pair and see the original text just fine:
Here is a long line of text -- test.txt
-- test.txt
so I know the original data still exists. I can also prepend the text and that works fine. The problem only asserts istself when suffixes are being added but I can't alter the positioning because I'm copying data into a database.
Any help would be appreciated.
Thanks in advance.
Code:
The filename is "test.txt"
Example of text in the file:
Here is a long line of text
Expected output:
Here is a long line of text -- test.txt
But what I'm getting:
-- text.txtong line of text
I can add a a carriage return or newline carriage return pair and see the original text just fine:
Here is a long line of text -- test.txt
-- test.txt
so I know the original data still exists. I can also prepend the text and that works fine. The problem only asserts istself when suffixes are being added but I can't alter the positioning because I'm copying data into a database.
Any help would be appreciated.
Thanks in advance.