Sponsored Content
Full Discussion: awk help string capture
Top Forums Shell Programming and Scripting awk help string capture Post 302878604 by jaydeep_sadaria on Saturday 7th of December 2013 08:59:32 AM
Old 12-07-2013
awk help string capture

Dear All

My input file as under. From it I want op fine as mention below. Kindly help. I use below code but not help.

code:
Code:
awk -F"  " '{print $2}'

ip file:
Code:
"BSCJNGR_IPA17_C" 030 131207 1305 RXOCF-353 PBD011_BGIL   BOTH AC FAULTY
"BSCJNGR_IPA17_C" 991 131207 1637 RXOCF-224 NAV001_BGIL   SITE ON BATTERY
"BSCJNGR_IPA17_C" 150 131207 1704 RXOCF-105 GKA001_BGIL   SITE ON BATTERY RECTIFIRE FAIL
"BSCJNGR_IPA17_C" 276 131207 1742 RXOCF-78 KEN001_BGIL   SITE ON BATTERY RECTIFIRE FAIL LOW BATTERY VOLTAGE BOTH AC FAULTY
"BSCJNGR_IPA17_C" 290 131207 1746 RXOCF-67 JAM034_BGIL   MAINS FAIL
"BSCJUN1_IPA17_C" 372 131207 1320 RXOCF-84 SPS001_BGIL   SITE ON BATTERY DG ON RECTIFIRE FAIL

op:
Code:
131207 1305  PBD011_BGIL   BOTH AC FAULTY
131207 1637  NAV001_BGIL   SITE ON BATTERY
131207 1704  GKA001_BGIL   SITE ON BATTERY RECTIFIRE FAIL
131207 1742 KEN001_BGIL   SITE ON BATTERY RECTIFIRE FAIL LOW BATTERY VOLTAGE BOTH AC FAULTY
131207 1746 JAM034_BGIL   MAINS FAIL
131207 1320 SPS001_BGIL   SITE ON BATTERY DG ON RECTIFIRE FAIL

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need to capture the service name from tnsnames.ora and create connect string

ghkjkjoj (4 Replies)
Discussion started by: chetankelvin
4 Replies

2. Shell Programming and Scripting

Need to capture certain text from a string in a different file

Hi, I wanted to know how i could accomplish this in a script using ksh. Lets say there is a file called test.dat and it has a certain input like below : . . Hi = 56 Hi = 67 . . 1 record(s) selected Now i need to capture the numbers after the = sign and store them in a... (3 Replies)
Discussion started by: Siddarth
3 Replies

3. UNIX for Advanced & Expert Users

capture data from matched string/line

Hi, I have a query as follows : suppose I am matching a string in a file say "start from here" and I want to pick up 'n' number of lines () from the matched string. Is there any way to do that ? 1) going forward I want to do this for every match for the above string 2) or limit this to... (2 Replies)
Discussion started by: sumoka
2 Replies

4. Shell Programming and Scripting

sed or awk command to replace a string pattern with another string based on position of this string

here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb cat dump.sql INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Discussion started by: vivek d r
10 Replies

5. Shell Programming and Scripting

Capture string contained on a line?

Hello All, I'm working on a script that runs the wget command on a list of IP Address in order to capture the data at that address' index.html. That part works fine to get the HTML code at that address but the data I'm trying to pull out is on a line containing a BUNCH of code for an HTML... (4 Replies)
Discussion started by: mrm5102
4 Replies

6. Shell Programming and Scripting

How to capture a string enclose by a pattern within a file?

Hi all, My file :test.txt just like this: ........................... From: 333:123<sip:88888888888@bbbb.com To: <sip:123456@aaaaa.com ......................... I want a script to capture the string between sip: & @ Expect output: 88888888888 123456 Please help! (4 Replies)
Discussion started by: Alex Li
4 Replies

7. Shell Programming and Scripting

String capture from ip file

Dear All From below mention input file I want op file as mention. Kindly help. IP file: "BSCGNR4_IPA17_C" 329 140119 0717 RXOCF-105 KJO001_BASC_NG AC FAULTY DG ON DOOR OPEN Needed OP: 140119 0717 KJO001_BASC_NG AC FAULTY DG ON DOOR OPEN Note that string mark in red as variable in... (3 Replies)
Discussion started by: jaydeep_sadaria
3 Replies

8. Shell Programming and Scripting

How to capture string below a line?

Hi, I need to collect IP address of all servers (more than 300). One way is put it in for loop and run nslookup for that servers list, but there are multiple fields in output. (tty/dev/pts/13): bash: 1011 > nslookup vplssor04 Server: 10.58.115.34 Address: 10.58.115.34#53 Name: ... (7 Replies)
Discussion started by: solaris_1977
7 Replies

9. Shell Programming and Scripting

Script to capture string in a log file

Dear all, I have a log file to be analysed. this log file contains vaiours lines of code starting with date timestamp. if my search string is exception then that resepective log statement starting from the date is required. example: 2014/10/01 16:14:44.459|>=|E|X|19202496|2832|... (5 Replies)
Discussion started by: shravee
5 Replies

10. Shell Programming and Scripting

Awk:String search more than one time and capture OP

Dear All During one of mine script developemnt i am stuch at one sub part. Requiremnt is as below kindly help me. IP file: 2015-02-28 10:10:15 AL M UtranCell UtranCell=RTE001X (unavailable) 2015-02-28 10:10:15 AL M UtranCell UtranCell=RTE001Y (unavailable) 2015-02-28 10:10:15 AL M... (6 Replies)
Discussion started by: jaydeep_sadaria
6 Replies
privatepw(1)						      General Commands Manual						      privatepw(1)

NAME
privatepw - Change WU-FTPD Group Access File Information SYNOPSIS
DESCRIPTION
If a site supports the SITE GROUP and SITE GPASS commands, it is necessary to be able to add, delete and list enhanced access group infor- mation. The utility is used to update this information in the group access file This is meant as an administrative tool and not to be run by the general user population. This command requires read/write permission to the appropriate ftpgroups file. Options In the options defined below, accessgroup is an alphanumeric name specified to a group. Please see the section for details. Create a new file. Delete the specified accessgroup information from the ftpgroups file. Use the specified ftpgroups file for all updates. If this option is not specified by default it takes the file. Set the real system group (defined in to the accessgroup specified. This is valid only when adding a new accessgroup or changing the password of an exist- ing accessgroup. List the contents of the appropriate ftpgroups file. This option causes the program to display copyright and version information, then terminate. Background After user logs in, the SITE GROUP and SITE GPASS commands may be used to specify an enhanced access group and associated password. If the group name and password are valid, the user becomes (via a member of the group list in the group access file The format of the group access file is: where access_group_name is an arbitrary (alphanumeric + punctuation) string. encrypted_password is the password encrypted via crypt(3), exactly like in real_group_name is the name of a valid group listed in AUTHOR
was developed by the Washington University, St. Louis, Missouri. SEE ALSO
ftpgroups(4), ftpaccess(4). privatepw(1)
All times are GMT -4. The time now is 08:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy