Sponsored Content
Full Discussion: Extract value from file
Top Forums Shell Programming and Scripting Extract value from file Post 302842639 by alister on Friday 9th of August 2013 03:22:06 PM
Old 08-09-2013
Quote:
Originally Posted by samrat dutta
Also need some details of how it does . What does $0 do and /\?
If you look at your AWK man page or search for AWK tutorials online, you'll quickly find the answer to you $0 question.

/ is a regular expression delimiter and \ is used to escape the character that follows it. If you are not familiar with regular expressions, you need to set aside some time for study.

Regards,
Alister
This User Gave Thanks to alister For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extract data from an XML file & write into a CSV file

Hi All, I am having an XML tag like: <detail sim_ser_no_1="898407109001000090" imsi_1="452070001000090"> <security>ADM1=????</security> <security>PIN1=????</security> <security>PIN2=????</security> ... (2 Replies)
Discussion started by: ss_ss
2 Replies

2. Shell Programming and Scripting

Extract a number from a line in a file and sed in another copied file

Dear all, I am trying to extract a number from a line in one file (task 1), duplicate another file (task 2) and replace all instances of the strings 300, in duplicated with the extracted number (task 3). Here is what I have tried so far: for ((k=1;k<4;k++)); do temp=`sed -n "${k}p"... (2 Replies)
Discussion started by: mnaqvi
2 Replies

3. Shell Programming and Scripting

Create shell script to extract unique information from one file to a new file.

Hi to all, I got this content/pattern from file http.log.20110808.gz mail1 httpd: Account Notice: close igchung@abc.com 2011/8/7 7:37:36 0:00:03 0 0 1 mail1 httpd: Account Information: login sastria9@abc.com proxy sid=gFp4DLm5HnU mail1 httpd: Account Notice: close sastria9@abc.com... (16 Replies)
Discussion started by: Mr_47
16 Replies

4. Shell Programming and Scripting

Extract rows from file based on row numbers stored in another file

Hi All, I have a file which is like this: rows.dat 1 2 3 4 5 6 3 4 5 6 7 8 7 8 9 0 4 3 2 3 4 5 6 7 1 2 3 4 5 6 I have another file with numbers like these (numbers.txt): 1 3 4 5 I want to read numbers.txt file line by line. The extract the row from rows.dat based on the... (3 Replies)
Discussion started by: shoaibjameel123
3 Replies

5. Shell Programming and Scripting

Perl extract number from file & write to file

I have 1 file that has elements as follows. Also the CVR(10) and the word "SAUCE" only appear once in the file so maybe a grep command would work? file1 CVR( 9) = 0.385E+05, ! VEHICLE CVR(10) = 0.246E+05, ! SAUCE CVR(11) = 0.162E+03, ! VEHICLE I need to extract the... (6 Replies)
Discussion started by: austinj
6 Replies

6. Shell Programming and Scripting

Extract data from XML file and write in CSV file

Hi friend i have input as following XML file <?xml version="1.0"?> <Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.054.001.02"> <BkToCstmrDbtCdtNtfctn> <GrpHdr><MsgId>LBP-RDJ-TE000000-130042430010001001</MsgId><CreDtTm>2013-01-04T03:21:30</CreDtTm></GrpHdr>... (3 Replies)
Discussion started by: mohan sharma
3 Replies

7. Shell Programming and Scripting

Shell Script to Dynamically Extract file content based on Parameters from a pdf file

Hi Guru's, I am new to shell scripting. I have a unique requirement: The system generates a single pdf(/tmp/ABC.pdf) file with Invoices for Multiple Customers, the format is something like this: Page1 >> Customer 1 >>Invoice1 + invoice 2 >> Page1 end Page2 >> Customer 2 >>Invoice 3 + Invoice 4... (3 Replies)
Discussion started by: DIps
3 Replies

8. Shell Programming and Scripting

How to extract start/end times from log file to CSV file?

Hi, I have a log file (log.txt) that which contains lines of date/time. I need to create a script to extract a CSV file (out.csv) that gets all the sequential times (with only 1 minute difference) together by stating the start time and end time of this period. Sample log file (log.txt) ... (7 Replies)
Discussion started by: Mr.Zizo
7 Replies

9. Shell Programming and Scripting

Extract sentence and its details from a text file based on another file of sentences

Hi I have two text files. The first file is TEXTFILEONE.txt as given below: <Text Text_ID="10155645315851111_10155645333076543" From="460350337461111" Created="2011-03-16T17:05:37+0000" use_count="123">This is the first text</Text> <Text Text_ID="10155645315851111_10155645317023456"... (7 Replies)
Discussion started by: my_Perl
7 Replies

10. UNIX for Beginners Questions & Answers

Extract file names from file and set variable to 'highest' one

HI Folks - I have a requirement where I need to scan a text file for a list of files. The file, we'll called it, files.txt looks like such: inbox/EBS/Client_GL_Detail_PBCS_112517_SEP2017.txt inbox/EBS/Client_GL_Detail_PBCS_112617_NOV2017.txt ... (9 Replies)
Discussion started by: SIMMS7400
9 Replies
usb_pipe_set_private(9F)				   Kernel Functions for Drivers 				  usb_pipe_set_private(9F)

NAME
usb_pipe_set_private, usb_pipe_get_private - USB user-defined pipe data-field facility SYNOPSIS
#include <sys/usb/usba.h> int usb_pipe_set_private(usb_pipe_handle_t pipe_handle, usb_opaque_t data); usb_opaque_t usb_pipe_get_private (usb_pipe_handle_t pipe_handle); INTERFACE LEVEL
Solaris DDI specific (Solaris DDI) PARAMETERS
For usb_pipe_set_private(): pipe_handle Pipe handle into which user-defined data is placed. data Data to store in the pipe handle. For usb_pipe_get_private(): pipe_handle Pipe handle from which user-defined data is retrieved. DESCRIPTION
The usb_set_driver_private() function initializes the user-private data field of the pipe referred to by pipe_handle, using data. The user-private data field is used to store any data the client desires and is not used in any way by the USBA or OS framework. Client driv- ers often store their soft-state here for convenient retrieval by their callback handlers. The usb_get_driver_private() function retrieves the user-private data stored via usb_set_driver_private(), from the pipe referred to by pipe_handle. RETURN VALUES
For usb_pipe_set_private(): USB_SUCCESS Private data has been successfully stored in pipe handle. USB_INVALID_PIPE pipe_handle argument is NULL or invalid. Pipe is closing or closed. USB_INVALID_PERM The pipe_handle argument refers to the default control pipe. For usb_pipe_get_private(): On success: usb_opaque_t pointer to data being retrieved. On failure: NULL. Fails if pipe handle is NULL or invalid. Fails if pipe handle is to a pipe which is closing or closed. CONTEXT
May be called from user, kernel or interrupt context. EXAMPLES
usb_pipe_handle_t pipe; /* Some driver defined datatype. */ xxx_data_t *data = kmem_zalloc(...); usb_pipe_set_private(pipe, data); ---- xxx_data_t *xxx_data_ptr = (xxx_data_t *)usb_pipe_get_private(pipe); ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Architecture |PCI-based systems | +-----------------------------+-----------------------------+ |Interface stability |Committed | +-----------------------------+-----------------------------+ |Availability |SUNWusb | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5), usb_pipe_open(9F), usb_alloc_request(9F) SunOS 5.11 5 Jan 2004 usb_pipe_set_private(9F)
All times are GMT -4. The time now is 05:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy