This is in file.txt:
redcar
bluecar
greencar
Im looking for ways to make it become:
redcar redcar
bluecar bluecar
greencar greencar
I've tried many ways using sed with no luck
This is in file.txt:
redcar
bluecar
greencar
Im looking for ways to make it become:
redcar redcar
bluecar bluecar
greencar greencar
I've tried many ways using sed with no luck
Here is a simple solution using paste:
paste -d ' ' file.txt file.txt
Try:
sed 's/\(.*\)/\1 \1/' data.txt
There Is More Than One Way To Do It:
Substitute two times the full sentence:
sed 's/.*/& &/'
Copy to hold space, append hold space to pattern space, fix newline:
sed 'h;G;s/\n/ /'
awk, concatenate whole sentence using field separator:
awk '$0=$0FS$0'
I would do it in perl but since you put awk, I will give you awk code
awk '{print $0,$0;}' file.txt
Edit: remove my useless cat