How to concatenate list of ID's? | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

How to concatenate list of ID's?

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 01-30-2013
buzzme buzzme is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 23 June 2014, 6:34 PM EDT
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
How to concatenate list of ID's?

Hi
I have attached list of id's and i need like below using shell script.

Input:

Code:
uid=c232346uid=c232408uid=c232438uid=c232584uid=c232587uid=c232635uid=c232637uid=c232732uid=c233003uid=c245377uid=c277345

output needed:


Code:
(uid=c232346)(uid=c232408)(uid=c232438)(uid=c232584)(uid=c232587)(uid=c232635)(uid=c232637)(uid=c232732)(uid=c233003)(uid=c245377)(uid=c277345)

Attached Files
File Type: txt list if id's.txt (14.5 KB, 12 views)

Last edited by Scrutinizer; 01-30-2013 at 04:56 PM.. Reason: code tags
Sponsored Links
    #2  
Old 01-30-2013
Scrutinizer's Avatar
Scrutinizer Scrutinizer is offline Forum Staff  
Moderator
 
Join Date: Nov 2008
Last Activity: 1 October 2014, 1:11 AM EDT
Location: Amsterdam
Posts: 9,487
Thanks: 280
Thanked 2,398 Times in 2,150 Posts
The format of your list of id's differs from your input specification..
Sponsored Links
    #3  
Old 01-30-2013
Chubler_XL's Avatar
Chubler_XL Chubler_XL is offline Forum Advisor  
Registered User
 
Join Date: Oct 2010
Last Activity: 1 October 2014, 12:14 AM EDT
Posts: 2,886
Thanks: 107
Thanked 913 Times in 854 Posts
Try this:


Code:
awk '/^uid=/ { printf "(%s)", $0} END { print "" }' "list if id's.txt"

Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
concatenate variables HackerSeabass Shell Programming and Scripting 4 02-18-2012 05:09 AM
Concatenate two lines in one Orbix Shell Programming and Scripting 5 04-29-2010 04:40 PM
Splitting a list @list by space delimiter so i can access it by using $list[0 ..1..2] shriyer Shell Programming and Scripting 1 07-29-2009 02:05 PM
How to concatenate all files. s80bob UNIX for Dummies Questions & Answers 1 08-22-2005 04:20 PM
Asking on concatenate variable blueberry80 UNIX for Dummies Questions & Answers 3 07-25-2003 09:46 AM



All times are GMT -4. The time now is 08:14 AM.