Sponsored Content
Full Discussion: Edit Multiple Files in VI
Top Forums UNIX for Dummies Questions & Answers Edit Multiple Files in VI Post 41451 by djschmitt on Monday 6th of October 2003 04:12:13 PM
Old 10-06-2003
Correct, but that still exits all the way out of VI. I would like to save and close the second file (foo2) and then be directly back into the first file (foo1).
 

10 More Discussions You Might Find Interesting

1. AIX

Locking a file when using VI to prevent multiple-edit sessions by diff users

At the office, we often have to edit one file with VI. We are 4-6 workers doing it and sometimes can be done at the same time. We have found a problem and want to prevent it with a file lock. Is it possible and how ? problem : Worker-a starts edit VI session on File-A at 1PM Worker-b... (14 Replies)
Discussion started by: Browser_ice
14 Replies

2. Shell Programming and Scripting

How to edit file sections that cross multiple lines?

Hello, I'm wondering where I could go to learn how to edit file sections that cross multiple lines. I'm wanting to write scripts that will add Gnome menu entries for all users on a system for scripts I write, etc. I can search an replace simple examples with sed, but this seems more complex. ... (8 Replies)
Discussion started by: Narnie
8 Replies

3. Shell Programming and Scripting

Read and edit multiple files using a while loop

Hi all, I would like to simply read a file which lists a number of pathnames and files, then search and replace key strings using a few vi commands: :1,$s/search_str/replace_str/g<return> but I am not sure how to automate the <return> of these vis commands when I am putting this in a... (8 Replies)
Discussion started by: cyberfrog
8 Replies

4. UNIX for Dummies Questions & Answers

Using AWK: Extract data from multiple files and output to multiple new files

Hi, I'd like to process multiple files. For example: file1.txt file2.txt file3.txt Each file contains several lines of data. I want to extract a piece of data and output it to a new file. file1.txt ----> newfile1.txt file2.txt ----> newfile2.txt file3.txt ----> newfile3.txt Here is... (3 Replies)
Discussion started by: Liverpaul09
3 Replies

5. UNIX for Advanced & Expert Users

awk - remove block of text, multiple actions for 'if', inline edit

I'm having a couple of issues. I'm trying to edit a nagios config and remove a host definition if a certain "host_name" is found. My thought is I would find host definition block containing the host_name I'm looking for and output the line numbers for the first and last lines. Using set, I will... (9 Replies)
Discussion started by: mglenney
9 Replies

6. Shell Programming and Scripting

Need Help to Edit multiple column of a file

Hello Team, I want to know if there is any one liner command , using which I can edit multiple column of a file. input file input.txt (comma separated), taran, 12.45, uttam, 23.40, babay karan, 12.45, raju, 11.40, rahulg I want to update, 2nd and 4th column, but want all those column... (8 Replies)
Discussion started by: Uttam Maji
8 Replies

7. Shell Programming and Scripting

Help require to edit multiple files

I have 6 different pipe delimiter files. My loads failing due to missing company code. File1: 31 st field is company code. 402660076310|2014-12-10 17:22:39|2280361|MRYKI|1||CA|92507|US||1|1|0|0|0||N|A1|ONT|1001891771660009250700402660076310|WM|0201|RALA |2014-12-12|5|2014-12-12|5||FRI - 12... (4 Replies)
Discussion started by: srikanth38
4 Replies

8. Shell Programming and Scripting

Gunzip and edit many files

Experts - I have an requirement to gunzip and edit many files in a pair of directories. I have two scripts that work great when run separately, but I'm having problems combining the two. The goal is to gunzip the files found in the first script and pipe them to the bash/sed script and... (9 Replies)
Discussion started by: timj123
9 Replies

9. Shell Programming and Scripting

Edit and replace the multiple values in a file in one iteration

Hi All, I am preserving OLD and NEW values and want to replace the values in one go instead of using multiple sed and mv commands. Please help. echo "\nEnter the new qStart time '${CODE}' - (Hit Enter for No Change): \c" read NEW echo "\nEnter the new qStop time '${CODE}' - (Hit Enter for... (2 Replies)
Discussion started by: sdosanjh
2 Replies

10. Shell Programming and Scripting

Using sed to edit multiple files

Created a shell script to invoke sed to edit multiple files, but am missing something. Here's the shell script: oracle:$ cat edit_scripts.sh #!/bin/sh #------------------------------------------------------------------------------ # edit_scripts.sh # # This script executes sed to make global... (4 Replies)
Discussion started by: edstevens
4 Replies
Config::Model::Iterator(3pm)				User Contributed Perl Documentation			      Config::Model::Iterator(3pm)

NAME
Config::Model::Iterator - Iterates forward or backward a configuration tree VERSION
version 2.021 SYNOPSIS
use Config::Model; use Log::Log4perl qw(:easy); Log::Log4perl->easy_init($WARN); # define configuration tree object my $model = Config::Model->new; $model->create_config_class( name => "Foo", element => [ [qw/bar baz/] => { type => 'leaf', value_type => 'string', level => 'important' , }, ] ); $model->create_config_class( name => "MyClass", element => [ foo_nodes => { type => 'hash', # hash id index_type => 'string', level => 'important' , cargo => { type => 'node', config_class_name => 'Foo' }, }, ], ); my $inst = $model->instance( root_class_name => 'MyClass' ); # create some Foo objects $inst->config_root->load("foo_nodes:foo1 - foo_nodes:foo2 ") ; my $my_leaf_cb = sub { my ($iter, $data_r,$node,$element,$index, $leaf_object) = @_ ; print "leaf_cb called for ",$leaf_object->location," " ; } ; my $my_hash_cb = sub { my ($iter, $data_r,$node,$element,@keys) = @_ ; print "hash_element_cb called for element $element with keys @keys " ; } ; my $iterator = $inst -> iterator ( leaf_cb => $my_leaf_cb, hash_element_cb => $my_hash_cb , ); $iterator->start ; ### prints # hash_element_cb called for element foo_nodes with keys foo1 foo2 # leaf_cb called for foo_nodes:foo1 bar # leaf_cb called for foo_nodes:foo1 baz # leaf_cb called for foo_nodes:foo2 bar # leaf_cb called for foo_nodes:foo2 baz DESCRIPTION
This module provides a class that is able to iterate forward or backward a configuration tree. The iterator will stop and call back user defined subroutines on one of the following condition: o A configuration item contains an error (mostly undefined mandatory values) o A configuration item contains warnings and the constructor's argument "call_back_on_warning" was set. o A configuration item has a "important" level and the constructor's argument "call_back_on_important" was set.. See level parameter for details. By default, the iterator will only stop on element with an "intermediate" experience. The iterator supports going forward and backward (to support "back" and "next" buttons on a wizard widget). CONSTRUCTOR
The constructor should be used only by Config::Model::Instance with the iterator method. Creating an iterator A iterator requires at least two kind of call-back: a call-back for leaf elements and a call-back for hash elements (which will be also used for list elements). These call-back must be passed when creating the iterator (the parameters are named "leaf_cb" and "hash_element_cb") Here are the the parameters accepted by "iterator": call_back_on_important Whether to call back when an important element is found (default 0). call_back_on_warning Whether to call back when an item with warnings is found (default 0). experience Specifies the experience of the element scanned by the wizard (default 'intermediate'). status Specifies the status of the element scanned by the wizard (default 'standard'). leaf_cb Subroutine called backed for leaf elements. See "Callback prototypes" in Config::Model::ObjTreeScanner for signature and details. (mandatory) hash_element_cb Subroutine called backed for hash elements. See "Callback prototypes" in Config::Model::ObjTreeScanner for signature and details. (mandatory) Custom callbacks By default, "leaf_cb" will be called for all types of leaf elements (i.e enum. integer, strings, ...). But you can provide dedicated call- back for each type of leaf: enum_value_cb, integer_value_cb, number_value_cb, boolean_value_cb, uniline_value_cb, string_value_cb Likewise, you can also provide a call-back dedicated to list elements with "list_element_cb" Methods start Start the scan and perform call-back when needed. This function will return when the scan is completely done. bail_out When called, a variable is set so that all call_backs will return as soon as possible. Used to abort wizard. go_forward Set wizard in forward (default) mode. go_backward Set wizard in backward mode. AUTHOR
Dominique Dumont, (ddumont at cpan dot org) SEE ALSO
Config::Model, Config::Model::Instance, Config::Model::Node, Config::Model::HashId, Config::Model::ListId, Config::Model::Value, Config::Model::CheckList, Config::Model::ObjTreeScanner, perl v5.14.2 2012-11-09 Config::Model::Iterator(3pm)
All times are GMT -4. The time now is 10:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy