Sponsored Content
Top Forums Shell Programming and Scripting Search field in text file and replace value Post 302769895 by Chubler_XL on Wednesday 13th of February 2013 08:01:40 PM
Old 02-13-2013
Danger with your code is that if the ID appears in another field (like serial number, location or name) It will replace that instead.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

automating file search and replace text

Hi, I am trying something like this: Let's say I have a file called File1 with contents: x=-0.3 y=2.1 z=9.0 I have another file, File2, with contents: xx= yy= zz= (nothing after "="). What I want to do is get the value of x in File1 and set it to xx in File2, i.e., xx=-0.3. And the... (3 Replies)
Discussion started by: ommatidia
3 Replies

2. Shell Programming and Scripting

How to search and replace text in same file

script is as below v_process_run=5 typeset -i p_cnt=0 pdata=/home/proc_data.log while do # execute script in background dummy_test.sh "a1" "a2" & p_cnt=$p_cnt+1 echo "data : $p_cnt : Y" >> $pdata done file created with following data in... (1 Reply)
Discussion started by: Vrgurav
1 Replies

3. UNIX for Dummies Questions & Answers

search and replace a specific text in text file?

I have a text file with following content (3 lines) filename : output.txt first line:12/12/2008 second line:12/12/2008 third line:Y I would like to know how we can replace 'Y' with 'N' in the 3rd line keeping 1st and 2nd lines same as what it was before. I tried using cat output.txt... (4 Replies)
Discussion started by: santosham
4 Replies

4. Shell Programming and Scripting

search and replace a text in a file

Hi all, I have a requirement where i have to search data between strings 'SELECT' and ';' and replace this text as "SELECT.....;" so that i can export this extracted string into a excel cell. Please suggest on this. (5 Replies)
Discussion started by: goutam_igate
5 Replies

5. Shell Programming and Scripting

text file search and replace with awk

hello all greeting for the day i have a text file as the following text.xml abcd<FIELD>123.456</FIELD>efgh i need to replace the value between <FIELD> and </FIELD> by using awk command. please throw some light on this. thank you very very much Erik (5 Replies)
Discussion started by: erikshek
5 Replies

6. Shell Programming and Scripting

replace 3rd field of space delimited text file

how to replace the 3rd colum? Each line begins similarly, but they all ends variously. XX YY 03 variable text here XX YY 03 more variable text here XX YY 03 even more variable text here really long setence XX YY 03 variable numbers also appear 03 11. 123 456 XX YY 03 the occasional comma,... (4 Replies)
Discussion started by: ajp7701
4 Replies

7. Shell Programming and Scripting

Search replace strings between single quotes in a text file

Hi There... I need to serach and replace a strings in a text file. My file has; books.amazon='Let me read' and the output needed is books.amazon=NONFOUND pls if anybody know this can be done in script sed or awk.. i have a list of different strings to be repced by NONFOUND.... (7 Replies)
Discussion started by: Hiano
7 Replies

8. Shell Programming and Scripting

Awk Search text string in field, not all in field.

Hello, I am using awk to match text in a tab separated field and am able to do so when matching the exact word. My problem is that I would like to match any sequence of text in the tab-separated field without having to match it all. Any help will be appreciated. Please see the code below. awk... (3 Replies)
Discussion started by: rocket_dog
3 Replies

9. Emergency UNIX and Linux Support

Search and replace in text file

Hi, I have gigabytes of text files that I need to search for "&" and replace with "&amp". Is there a way to do this efficiently (like sed command)? Hope you could help. Thanks. (17 Replies)
Discussion started by: daytripper1021
17 Replies

10. Shell Programming and Scripting

awk search/replace specific field, using variables for regexp & subsitution then overwrite file

Hello, I'm trying the solve the following problem. I have a file which I intend to use as a csv called master.csv The columns are separated by commas. I want to change the text on a specific row in either column 3,4,5 or 6 from xxx to yyy depending upon if column 1 matches a specified pattern.... (3 Replies)
Discussion started by: cyphex
3 Replies
inquiry-device-type(9P) 				   Kernel Properties for Drivers				   inquiry-device-type(9P)

NAME
inquiry-device-type, inquiry-vendor-id, inquiry-product-id, inquiry-revision-id, inquiry-serial-no - inquiry properties for SCSI devices DESCRIPTION
These are optional properties, typically created by the system, for SCSI target devices. References to these properties should use their sys/scsi/impl/inquiry.h defined names. inquiry-device-type is an integer property. When present, the least significant byte of the value indicates the device type as defined by the SCSI standard. Consumers of this property should compare the property values with DTYPE_* values defined in sys/scsi/generic/inquiry.h. inquiry-vendor-id is a string property. When present, it contains the vendor information. This information typically comes from the scsi_inquiry(9S) "inq_vid" field. inquiry-product-id is a string property. When present, it contains the product identification. This information typically comes from the scsi_inquiry(9S) "inq_pid" field. inquiry-revision-id is a string property. When present, it contains the product revision. This revision typically comes from the scsi_inquiry(9S) "inq_rev" field. inquiry-serial-no is a string property. When present, it contains the serial number. The serial number is typically obtained from the EVPD "Unit Serial Number" SCSI INQUIRY data (page 0x80). SEE ALSO
scsi_inquiry(9S) Writing Device Drivers NOTES
Values established at tran_tgt_init(9E) time by an HBA driver take precedence over values established by the system, and HBA driver values may not be the same length as the typical scsi_inquiry(9S) field. SunOS 5.11 18 May 2001 inquiry-device-type(9P)
All times are GMT -4. The time now is 06:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy