Background: Copy a column of data from Excel to TXT, and then put it under Lunx, and find that each line ends with a fixed number of spaces, and I want to add a fixed field to the end of each line and separate the output with commas.
Cat Fastjason.txt | Awk-f/' {print $} ' | Sort | Uniq > Fast.log To remove a specific field; Cat Fast.log |xargs echo >fast.log Remove the indefinite number of spaces at the end of each line, all on one line, and each application separated by a space; Sed-i ' s//\n/g ' Fast.log , the space is transformed by a line character, and then at the end of each line. War, Sed-i ' s/$/&.war/g ' fast.log;cat fast.log |xargs echo output to one line, each application separated by spaces >sp.log;sed-i ' s// ,/g ' sp.log the space to a comma.
Cat Fastjason.txt | awk-f/' {print $} ' |sort |uniq|xargs echo >a.log
Sed ' s//\n/g ' A.log > B.log
Sed ' s/$/&.war/g ' b.log >c.log
Cat C.log |xargs Echo >d.log
Sed ' s/\n/,/g ' b.log > D.log
A string that handles a column of copy in Excel under Linux, removing the end of line space and adding special fields