Operating System - HP-UX
1832921 Members
2393 Online
110048 Solutions
New Discussion

Re: perl or shell to comma separate and join lines.

 
Ratzie
Super Advisor

perl or shell to comma separate and join lines.

I have a large file that looks like:
USER
USERBU
USERSKILL
AREA
JOBSKILL

And I want it to look like:
USER,USERBU,USERSKILL,AREA,JOBSKILL
2 REPLIES 2
Ratzie
Super Advisor

Re: perl or shell to comma separate and join lines.

Sorry answered my own question
:%s/\/t/,/g
Robert Bennett_3
Respected Contributor

Re: perl or shell to comma separate and join lines.

cat | sed -e:a -e'$!N;s/\n/,/;ta'
"All there is to thinking is seeing something noticeable which makes you see something you weren't noticing which makes you see something that isn't even visible." - Norman Maclean