Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- EN1
- EN2
- EN3
- EN4
- EN5
- EN1,EN2,EN3,EN4,EN5
- awk 'BEGIN { OFS = ","} { printf $1}' input.txt
- awk 'BEGIN{ORS=","}1' input.txt
- EN1,EN2,EN3,EN4,EN5,
- tr 'n' ',' <input.txt
- <input.txt head -c -1 | tr 'n' ,
- columns=$(<input.txt tr 'n' ',')
- echo "${columns%,}"
- $ xargs <input.txt | sed -e 's/ /,/g'
- EN1,EN2,EN3,EN4,EN5
- EN1 foo bar
- EN2 bar foo
- EN3 baz quux
- EN4 abc def
- EN5 hij klm
- $ awk '{print $1}' input.txt | xargs | sed -e 's/ /,/g'
- EN1,EN2,EN3,EN4,EN5
- $ sed -e 's/ /--space--/g' input.txt | xargs | sed -e 's/ /,/g' -e 's/--space--/ /g'
- EN1 foo bar,EN2 bar foo,EN3 baz quux,EN4 abc def,EN5 hij klm
- $ paste -sd, input.txt
- EN1,EN2,EN3,EN4,EN5
- $
- perl -pe '(eof)?s/s+$//:s/s+$/,/' input.txt
- EN1,EN2,EN3,EN4,EN5
- sed -z 's/n/,/g' input.txt
- sed -z 's/n/,/g' input.txt | sed 's/,$/n/'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement