This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
fuss:awk [2017/02/22 18:30] – external edit 127.0.0.1 | fuss:awk [2017/12/25 11:33] – [Remove Duplicate Entries in File Without Sorting] office | ||
---|---|---|---|
Line 44: | Line 44: | ||
</ | </ | ||
+ | ====== Merge Lines by Two in File ====== | ||
+ | |||
+ | Given a file with the contents: | ||
+ | < | ||
+ | Q: What is this? | ||
+ | A: This is a FAQ! | ||
+ | </ | ||
+ | |||
+ | and you would like to achieve: | ||
+ | < | ||
+ | Q: What is this? A: This is a FAQ! | ||
+ | </ | ||
+ | |||
+ | then the following '' | ||
+ | <code bash> | ||
+ | awk ' | ||
+ | </ | ||
+ | |||
+ | will merge all the lines in a file by two. | ||