Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Calling all the awk gurus out there. Post 302782641 by savigabi on Tuesday 19th of March 2013 08:52:08 AM
Old 03-19-2013
Quote:
Originally Posted by Scrutinizer
How about sed:
Code:
$ sed -e :a -e 's/\(.*\) \([a-z_]\{1,\}=\)/\1;\2/;ta' file
User1;id=11111;gecos=John Doe;groups=group1, group2;account_locked=false

Or just the values with awk:
Code:
$ awk -F' *[a-z_]+=' '{$1=$1}1' OFS=';'  file
User1;11111;John Doe;group1, group2;false

Awesome, thank you so much Scrutinizer, that works perfectly! I will now know next time how to do this.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with shell script - Unix Gurus calling

Unix Gurus, I have been breaking my head to get this done..seems simple.. I need to read a flat file and based on a key word in a line, i need to skip the previous 3 lines. eg : Line1 Line2 Line3 Line4 Line5 Line6 Error Line7 Line8 Line9 Error Line10 (4 Replies)
Discussion started by: ravred
4 Replies

2. Shell Programming and Scripting

Calling ipcrm from awk

Hello, With next simple command line I get all allocated semaphore numbers: ipcs -s | awk 'NR > 3 {print $2}' Now I want to add ipcrm -s before each semaphore id and actually delete every last of them. The question is: Can I do the operation in a command itself, without redirecting awk... (2 Replies)
Discussion started by: BaruchLi
2 Replies

3. Solaris

calling script from awk

Hi, I'm not sure, there is solution exist for this problem. I'm facing problem in calling a unix script from awk code. Here is code nawk -F'=' ' BEGIN { } function runtest(string) { LINE } /^/ { # getting module name t=$1 module=substr(t,2,(length(t)-2)) runtest(module) }... (1 Reply)
Discussion started by: luckybalaji
1 Replies

4. Shell Programming and Scripting

calling mysql gurus : need help with my view

hi there I have a view which is working fine, but i have been told that i need to make sure the resulting output excludes all rows with nic_status equal to the string "removed". Does anybody know in which part of the code below i would place the conditional ... WHERE nic_status !=... (4 Replies)
Discussion started by: hcclnoodles
4 Replies

5. Shell Programming and Scripting

calling a method inside awk

Hi All, How do we call a method existing in another file inside awk. After matching a pattern i want to call a method secureCopy that exists in another file, but method not getting called: ls -l | awk -v var2=$servername -v var1=$srcserverpath -v var3=$tgtpath '... (1 Reply)
Discussion started by: abhinav192
1 Replies

6. Shell Programming and Scripting

Calling of search using awk

Database rina lives:fatin:20:20:20 rina:fatin:20:20:20 i am having a small problem in extracting out the information from the database. For example, if i were to input a book titled rina into my search , i would only want it to display the row which has the title rina, like this ... (4 Replies)
Discussion started by: gregarion
4 Replies

7. Shell Programming and Scripting

Calling awk from csh

I am trying to call awk from a csh script using awk '{print $1, -$2, $3}' $fvmod.vel > $fvmod.xzv and getting awk: Command not found. Running awk '{print $1, -$2, $3}' $fvmod.vel > $fvmod.xzv on the command line with the actual filenames works (2 Replies)
Discussion started by: kristinu
2 Replies

8. Shell Programming and Scripting

Calling awk fom csh

I have to call two awk scripts where the second one used the output from the first one. Am wondering if it may happen that the second awk might start before the first awk finished creating the file... if ($nAnomaly == 1) then awk -v anomaly=$Anom -v zloc="$zmin/$zmax" -v dz=$dz \ ... (1 Reply)
Discussion started by: kristinu
1 Replies

9. Shell Programming and Scripting

calling awk from php not working

I want to run awk from php to do some text processing. I am giving an extremely simple example below: onecol.awk file ------------------- { print "Hello!"; } f1.txt --------- aaa ccc eee f2.txt --------- (6 Replies)
Discussion started by: mary271
6 Replies

10. Shell Programming and Scripting

Calling array inside awk

Hello I have the file df.tmp FS is actually the / FS but escape character\ and end of line $ is used in order to fetch exctly / and not other filesystems. awk '/\/$/ {print $(NF-1)+0}' df.tmp will work properly and return a value eg. 60 but when I am trying to issue the command with the array... (3 Replies)
Discussion started by: drbiloukos
3 Replies
MPI_Group_difference(3OpenMPI)											    MPI_Group_difference(3OpenMPI)

NAME
MPI_Group_difference - Makes a group from the difference of two groups. SYNTAX
C Syntax #include <mpi.h> int MPI_Group_difference(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup) Fortran Syntax INCLUDE 'mpif.h' MPI_GROUP_DIFFERENCE(GROUP1, GROUP2, NEWGROUP, IERROR) INTEGER GROUP1, GROUP2, NEWGROUP, IERROR C++ Syntax #include <mpi.h> static Group Group::Difference(const Group& group1, const Group& group2) INPUT PARAMETERS
group1 First group (handle). group2 Second group (handle). OUTPUT PARAMETERS
newgroup Difference group (handle). IERROR Fortran only: Error status (integer). DESCRIPTION
The set-like operations are defined as follows: o union -- All elements of the first group (group1), followed by all elements of second group (group2) that are not in the first group o intersect -- all elements of the first group that are also in the second group, ordered as in first group o difference -- all elements of the first group that are not in the second group, ordered as in the first group Note that for these operations the order of processes in the output group is determined primarily by order in the first group (if possible) and then, if necessary, by order in the second group. Neither union nor intersection are commutative, but both are associative. The new group can be empty, that is, equal to MPI_GROUP_EMPTY. ERRORS
Almost all MPI routines return an error value; C routines as the value of the function and Fortran routines in the last argument. C++ func- tions do not return errors. If the default error handler is set to MPI::ERRORS_THROW_EXCEPTIONS, then on error the C++ exception mechanism will be used to throw an MPI:Exception object. Before the error value is returned, the current MPI error handler is called. By default, this error handler aborts the MPI job, except for I/O function errors. The error handler may be changed with MPI_Comm_set_errhandler; the predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned. Note that MPI does not guarantee that an MPI program can continue past an error. SEE ALSO
MPI_Group_free Open MPI 1.2 September 2006 MPI_Group_difference(3OpenMPI)
All times are GMT -4. The time now is 08:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy