Apr 4, 2010 #1 arunrr Programmer Joined Oct 2, 2009 Messages 103 Location US Hello, my input is... S Arnold and DJ Harper K Harrison J Summer R Shank I need a one line output as follows... S Arnold and DJ Harper, K Harrison (TV), K Summer (Referee), R Shank (Reserve) thanks a ton! Arun
Hello, my input is... S Arnold and DJ Harper K Harrison J Summer R Shank I need a one line output as follows... S Arnold and DJ Harper, K Harrison (TV), K Summer (Referee), R Shank (Reserve) thanks a ton! Arun
Apr 4, 2010 1 #2 stefanwagner Programmer Joined Oct 19, 2003 Messages 2,373 Location DE Code: sed '3s/\(.*\)/ \1 (Referee)/;' file | tr "\n" "," This will change line 4 (substitute) and tr (translate) changes the linebrakes to comma. The sed-command may be combined with others, separated by ; Code: sed '3s/\(.*\)/ \1 (Referee)/;2s/\(.*\)/ \1 (TV)/;' file | tr "\n" "," The last step is left as an excercise to the reader. don't visit my homepage: http://home.arcor.de/hirnstrom/minis/index.html Upvote 0 Downvote
Code: sed '3s/\(.*\)/ \1 (Referee)/;' file | tr "\n" "," This will change line 4 (substitute) and tr (translate) changes the linebrakes to comma. The sed-command may be combined with others, separated by ; Code: sed '3s/\(.*\)/ \1 (Referee)/;2s/\(.*\)/ \1 (TV)/;' file | tr "\n" "," The last step is left as an excercise to the reader. don't visit my homepage: http://home.arcor.de/hirnstrom/minis/index.html
Apr 4, 2010 Thread starter #3 arunrr Programmer Joined Oct 2, 2009 Messages 103 Location US Thanks a lot!! Arun Upvote 0 Downvote
Apr 5, 2010 #4 feherke Programmer Joined Aug 5, 2002 Messages 9,541 Location RO Hi Here on Tek-Tips we used to thank for the received help by giving stars. Please click the * [navy]Thank stefanwagner for this valuable post![/navy] at the bottom of stefanwagner's post. That way you both show your gratitude and indicate this thread as helpful. Feherke. http://free.rootshell.be/~feherke/ Upvote 0 Downvote
Hi Here on Tek-Tips we used to thank for the received help by giving stars. Please click the * [navy]Thank stefanwagner for this valuable post![/navy] at the bottom of stefanwagner's post. That way you both show your gratitude and indicate this thread as helpful. Feherke. http://free.rootshell.be/~feherke/
Apr 5, 2010 Thread starter #5 arunrr Programmer Joined Oct 2, 2009 Messages 103 Location US Thanks Feherke, Done! Will follow in the future... Arun Upvote 0 Downvote