Sponsored Content
Top Forums Shell Programming and Scripting Change 2 values in 2 different lines Post 303036693 by API on Monday 8th of July 2019 09:09:40 AM
Old 07-08-2019
Change 2 values in 2 different lines

Hello all,

I have a file looks like a xml file:

Code:
....
<SrcIntDef>WAUXDFXXX<\SrcIntDef>
<SrcIntRep>WUBGIUNXXX<\SrcIntRep>
...

For these 2 lines I will change the values. So for result it should look like:

Code:
...
<SrcIntDef>WUBGIUNXXX<\SrcIntDef>
<SrcIntRep>WAUXDFXXX<\SrcIntRep>
...

How should I realize this?

Tx in advance.

Last edited by RavinderSingh13; 07-08-2019 at 11:02 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Change the Values in a file

I have a data file. I want to write a shell script that reads a data file and reads position 19 thru 24. if the data in those fields is 002006, than it should change it to 002007. example: hello world hello 002006 hello world hello world hello world hello 002005 hello world hello world... (6 Replies)
Discussion started by: rudoraj
6 Replies

2. Shell Programming and Scripting

How do I change the values in a file?

TRASH_PATH:~/deleted/ MAX_VERSIONS:5 FILE_MAX_SIZE:1024 FOLDER_MAX_SIZE:8096 TRASH_MAX_SIZE:1024 LOG_MAX_SIZE:100 how do i change the value of TRASH_MAX_SIZE to 2040 using the script? the filename is config.ini please advice Use code tags, ty. (5 Replies)
Discussion started by: classic
5 Replies

3. Shell Programming and Scripting

Perl script to change values in datafiles

Hi all, Let say I have 2 files, 1 is source file and another is destination file. Source file contains the following : Kitten Dogs Donkey Chicken Turkey And destination file contains : Kitten, 0 Dogs, 0 Donkey, 0 Chicken, 0 Turkey, 0 Kitten, 0 Dogs, 0 Donkey, 0 (16 Replies)
Discussion started by: luna_soleil
16 Replies

4. Shell Programming and Scripting

How to change values in datafile from source file

Hi all, I have this source file source.txt : hdrEthernetSwitch1IPAddress 112.13.9.34 hdrEthernetSwitch2IPAddress 112.13.8.245 noOfRevASLAvailable 8000 noOfRevASLInUse 122 maxDOSPayload 7777 pcmdEvdoRUM Enabled pcmdEvdoFlow Enabled And I have this datafile to be modified : ... (5 Replies)
Discussion started by: luna_soleil
5 Replies

5. Shell Programming and Scripting

Finding change in values

I have an array X = ( -100 -90 -80 -70 -60 -50 -40 30 40 50 60 70 80 90 100 ) I want to find the place where values change from negative to positive. (8 Replies)
Discussion started by: kristinu
8 Replies

6. Shell Programming and Scripting

Change nice values of a queue

Hello Guys I need your suggestions for the below We have few unix jobs running in different queues Is there any way I can manage which jobs goes to which queue and to change their nice value as well Thanks a lot for your valuable suggestions (1 Reply)
Discussion started by: Pratik4891
1 Replies

7. Shell Programming and Scripting

How to change certain values in a file

Hi all, i need help to replace certain values in a file. I need the script to check and match the ID and exNum1. if match, values in $3 (file2.txt) need to replace the value for 'START' (file1.txt) for each match. The sample structure is like this:- File1.txt ID P_6 START ... (4 Replies)
Discussion started by: redse171
4 Replies

8. Shell Programming and Scripting

Change values in .conf file with a script

This is my first time posting here...so be gentle. Suppose I have a test.conf file that contains a value such as a IP. I would like to be able to use the Dialog Utility in Linux to allow me to enter the new IP in a Dialog form...and the results get saved into the test.conf file in the place... (4 Replies)
Discussion started by: calahanp
4 Replies

9. Shell Programming and Scripting

Using sed to change values after a specific string

Hello I have a script that searches a file for a specific string and then changes the nth column after that string. I have searched online for how to do this with sed but have not seemed to find a solution that works for me. I am using bash. Some background info: - Currently I am using awk to... (4 Replies)
Discussion started by: prodigious8
4 Replies

10. UNIX for Beginners Questions & Answers

How to change values in xml file?

I have xml file like below, i want change the values at default-value place of each argument name using shell script. like where argument name= protocol and default-value=tcp, where argument name =port and default-value= 7223, where argument name = username and default-value=test, example ... (12 Replies)
Discussion started by: s1s2s3s4
12 Replies
LIBXML_GET_ERRORS(3)							 1						      LIBXML_GET_ERRORS(3)

libxml_get_errors - Retrieve array of errors

SYNOPSIS
array libxml_get_errors (void ) DESCRIPTION
Retrieve array of errors. RETURN VALUES
Returns an array with LibXMLError objects if there are any errors in the buffer, or an empty array otherwise. EXAMPLES
Example #1 A libxml_get_errors(3) example This example demonstrates how to build a simple libxml error handler. <?php libxml_use_internal_errors(true); $xmlstr = <<< XML <?xml version='1.0' standalone='yes'?> <movies> <movie> <titles>PHP: Behind the Parser</title> </movie> </movies> XML; $doc = simplexml_load_string($xmlstr); $xml = explode(" ", $xmlstr); if (!$doc) { $errors = libxml_get_errors(); foreach ($errors as $error) { echo display_xml_error($error, $xml); } libxml_clear_errors(); } function display_xml_error($error, $xml) { $return = $xml[$error->line - 1] . " "; $return .= str_repeat('-', $error->column) . "^ "; switch ($error->level) { case LIBXML_ERR_WARNING: $return .= "Warning $error->code: "; break; case LIBXML_ERR_ERROR: $return .= "Error $error->code: "; break; case LIBXML_ERR_FATAL: $return .= "Fatal Error $error->code: "; break; } $return .= trim($error->message) . " Line: $error->line" . " Column: $error->column"; if ($error->file) { $return .= " File: $error->file"; } return "$return -------------------------------------------- "; } ?> The above example will output: <titles>PHP: Behind the Parser</title> ----------------------------------------------^ Fatal Error 76: Opening and ending tag mismatch: titles line 4 and title Line: 4 Column: 46 -------------------------------------------- SEE ALSO
libxml_get_last_error(3), libxml_clear_errors(3). PHP Documentation Group LIBXML_GET_ERRORS(3)
All times are GMT -4. The time now is 06:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy