Sponsored Content
Top Forums Shell Programming and Scripting To Change the file format Pls Help!!! Post 302173916 by Klashxx on Sunday 9th of March 2008 05:05:01 AM
Old 03-09-2008
Other way:
Code:
> cat file 
john::208:johnson
john::208:mery
john::208:test
admin:*:1:johnson
admin:*:1:test
juan:u:107:juan
juan:u:107:jose
kyle:l:209:kyle

Code:
>awk '
function p_f ()
{
printf("%s",pf)
for (j=0;j<=i;++j)
   printf("%s",FS""a[j])
printf("\n")
i=0
}
{
f=$1FS$2FS$3
if ( f != pf &&  NR )
   p_f()
i++
a[i]=$NF
pf=f
}
END{
p_f()}
' FS=':' file
john::208::johnson:mery:test
admin:*:1::johnson:test
juan:u:107::juan:jose
kyle:l:209::kyle

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Change format to file II

hi all... i have a big problem, and i hope someone can help me... i have a flat file, and its columns are separated by comma (CSV), something like this: 78 , 204R180 , 90/100 , 200001 , 12 ,200002 ,13 ..... 78 , 204R180 , 90/100 , 200001 , 29 ,200002 ,30 ..... 78 , 204R180 , 90/100 ,... (0 Replies)
Discussion started by: DebianJ
0 Replies

2. Shell Programming and Scripting

Change file format

Hi I have a file in the following format I have to convert this into four files , in the format as below. Data under Process SFA SUccess Section gets into file Named SFA_SUCCESS inthe following format ctr1,120 ctr2,1785 Data under Process SFA FAil gets into file Named SFA_Fail inthe... (2 Replies)
Discussion started by: sapics
2 Replies

3. Shell Programming and Scripting

script to change the date format in a file

i have many files with date format of 6-9-2008 and i want a script that can change the format to 2008-06-09 Thanks (15 Replies)
Discussion started by: shehzad_m
15 Replies

4. Shell Programming and Scripting

How to change date format in file

Hello! I have a textfile that look like this: "83d1:46:2b";"20091008190000";"Rögle BK - Skellefteå";"Swedish" "d4c:46:21";"20091008190000";"Södertälje - Brynäs";"Swedish" "d4b:46:2";"20091008190000";"HV 71 - Färjestad";"Swedish" "838:46:b";"20091010160000";"Skellefteå - HV 71";"Swedish"... (2 Replies)
Discussion started by: condmaster
2 Replies

5. Shell Programming and Scripting

Change file output format

I have a file which has following contents usmtnz-dinfsi19 62 61 18400 18800 99.7 usmtnz-dinfsi19 62 61 18400 18800 99.7 i want the o/p to be like date (7 Replies)
Discussion started by: fugitive
7 Replies

6. Shell Programming and Scripting

howto change format of file?

Hi I have a file with this inside: How can I change it to: thanks a lot regards Israel. (3 Replies)
Discussion started by: iga3725
3 Replies

7. Shell Programming and Scripting

File date format how to change

Hi All, Below are the unix files taken by the help of ls -lrt -rw-r--r-- 1 kbehera Domain Users 293 Jul 27 13:33 sand.txt -rw-r--r-- 1 kbehera Domain Users 4 Jul 27 13:37 sand1.txt -rw-r--r-- 1 kbehera Domain Users 293 Jul 27 15:30 new_sand.txt -rw-r--r-- 1 kbehera Domain Users 0 Jul 27... (2 Replies)
Discussion started by: krupasindhu18
2 Replies

8. Shell Programming and Scripting

Change the file format

gpio_rw = gpiochip162 audio_aplay = HDMI_0 audio_aplay = HDMI_1 audio_aplay = HDMI_2 graphic_xrandr_show = USB1 graphic_xrandr_show = USB2 graphic_xrandr_show = USB3 graphic_change_resolution = eDP1 gpio_rw = "gpiochip162" audio_aplay = "HDMI_0 HDMI_1 HDMI_2" graphic_xrandr_show =... (3 Replies)
Discussion started by: yanglei_fage
3 Replies

9. Shell Programming and Scripting

Date format change in a csv file

Hi, We have csv file where date is coming in MM/DD/YYYY HH:MM:SS (06/23/2015 20:59:12) in multiple places But we need to change the date format to DD/Mon/YYYY HH:MM:SS (23/Jul/2015 20:59:12) using shell script. Please let us know how can we achieve the same. (16 Replies)
Discussion started by: dholea
16 Replies

10. UNIX for Beginners Questions & Answers

Change date format in a file.

Hi all, I have a file as below, i would like the change the format of the time from "11/7/2019 20:12" to "2019-07-11 20:12:00" in the last coloumn. any awk solution on this. Input: 2,0,695016,1961612,497212,5800804,0,0,161,33,7605,12226,23,10,66,0,0,34,11/7/2019 20:10... (4 Replies)
Discussion started by: Raghuram717
4 Replies
xpausers(7)							SAORD Documentation						       xpausers(7)

NAME
XPAUsers - Distinguishing Users SYNOPSIS
XPA normally distinguishes between users on a given host, but it is possible to send data to access points belonging to other users. DESCRIPTION
A single XPA name service typically serves all users on a given machine. Two users can register the same XPA access points on the same machine without conflict, because the user's username is registered with each access point and, by default, programs such as xpaget and xpaset only process access points of the appropriate user. For example: XPA xpa1 gs 838e2f67:1262 eric XPA xpa2 gs 838e2f67:1266 eric XPA xpa1 gs 838e2f67:2523 john XPA xpa2 gs 838e2f67:2527 john Here the users "eric" and "john" both have registered the access points xpa1 and xpa2. When either "john" or "eric" retrieves information from xpa1, they will process only the access point registered in their user name. If you want to access another user's XPA access points on a single machine, use the -u [user] option on xpaset, xpaget, etc. For example, if eric executes: xpaget -u john xpa1 he will access John's xpa1 access point.Use "*" to access all users on a given machine: xpaget -u "*" xpa1 Note that the XPA Environment Variable XPA_NSUSERS can be used to specify the default list of users to process: setenv XPA_NSUSERS "eric,john" will cause access points from both "eric" and "john" to be processed by default. SEE ALSO
See xpa(7) for a list of XPA help pages version 2.1.14 June 7, 2012 xpausers(7)
All times are GMT -4. The time now is 06:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy