Answer the question
In order to leave comments, you need to log in
How to merge lines through grep \ sed into one?
Tell me how you can merge into one line and whether it can be done through grep \ sed.
1 text file, lines of this format
LineA, numberA, number, number
LineB, numberA, number, number
Number, number, LineB, numberB
Number, number, LineA, numberB
Must be converted to:
LineA, numberA, numberB
LineB, numberA, numberB
Answer the question
In order to leave comments, you need to log in
join -t , -j 1 \
<(sed 's/\([^,]*,[^,]*\).*/\1/g' < 1.txt | sort) \
<(sed 's/[^,]*,[^,]*,//g' < 2.txt | sort)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question