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

  Unix/Linux 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 Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 01-30-2013
buzzme buzzme is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 5 February 2015, 12:19 AM EST
Posts: 45
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 05:56 PM.. Reason: code tags
Sponsored Links
    #2  
Old Unix and Linux 01-30-2013
Scrutinizer's Unix or Linux Image
Scrutinizer Scrutinizer is online now Forum Staff  
Moderator
 
Join Date: Nov 2008
Last Activity: 5 March 2015, 1:38 PM EST
Location: Amsterdam
Posts: 9,966
Thanks: 321
Thanked 2,588 Times in 2,314 Posts
The format of your list of id's differs from your input specification..
Sponsored Links
    #3  
Old Unix and Linux 01-30-2013
Chubler_XL's Unix or Linux Image
Chubler_XL Chubler_XL is offline Forum Staff  
Moderator
 
Join Date: Oct 2010
Last Activity: 22 February 2015, 9:28 PM EST
Posts: 3,104
Thanks: 119
Thanked 1,008 Times in 945 Posts
Try this:


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

Sponsored Links
Closed Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Unix or Linux Image 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 06:09 AM
Concatenate two lines in one Orbix Shell Programming and Scripting 5 04-29-2010 05: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 03:05 PM
How to concatenate all files. s80bob UNIX for Dummies Questions & Answers 1 08-22-2005 05:20 PM
Asking on concatenate variable blueberry80 UNIX for Dummies Questions & Answers 3 07-25-2003 10:46 AM



All times are GMT -4. The time now is 02:41 PM.