I need to build command for line command editor vi. I want to take the whole string and assemble it in a regular expression. He then folded into another shape.
You gave us no details. Makes it hard to help you.
An overview of what you want: .exrc is a setup file for vi, where you define keystrokes to be macros.
Create the macros you need in the .exrc file in your home directory.
To rearrange the first five fields of all lines in a file named file that contain five or more <hyphen> separated fields and leave other lines unchanged, you could use:
Note that BRE back references count fields starting at 1, not 0.
If you are in vi with file currently loaded into the editing buffer and want to make that change to all lines in the buffer that match that pattern, the command to type into vi would be:
If this isn't what you want, you need to write a much clearer statement of your requirements, tell us what operating system you're using, what shell you're using, where these strings are located, where you want the results to be placed, etc.
Note, however, that the above code will NOT change "duck" to "duk" while it rearranges the fields. If you really want to do that, you'll need to further explain the logic used to determine which letters to drop from which fields while rearranging fields.
Hi Guru's,
I'm new at Unix. I am tasked to monitor the filesystem utilization on OS level (Unix) and DB (Sybase) for multiple systems. I am thinking to use vi editor and make a file, execute that file and all the file systems I need to monitor will be be shown.
My script inside vi goes in... (8 Replies)
I have input file
04000912|100:|||||]|101:||]|creDate:1451876825000|1441324800000:]|1444003200000:]|1446595200000:]|1449187200000:]|1451865600000:]
I have to get output as below
ID|Re_Date|Re_Value|Re_date
04000912|100|40.0|44
04000912|100|50.0|55
04000912|100|60.0|66... (4 Replies)
Hi Folks
I have opened a log file in Vi editor
vi abc.logPlease advise me how to finally quit from Vi editor, which command is there..!
Is it :q<Enter> (1 Reply)
Is it possible to find all files based on the date of creation? And if so, how? I've been looking at the find command but it seems that only modification times are used as an option. (1 Reply)
I've this command in a script which edits the file ...
bash$ cat temp_file.txt
THREAD #2 2 Running
bash$ (echo "s/THREAD #2/d"; echo 'wq') | ex -s temp_file.txt
bash$ cat temp_file.txt
THREAD #2 2 Running
If i've more than 1 line it easily deletes the line, but if it is the last line... (3 Replies)
Hi all,
Here is an example, I would wan to search for all string consists of IMP but not IMP-00015. Values other than 00015 is fine, is there anyone knows how to do that?
Thanks. (2 Replies)
Here is my problem,
I manage a SunOs 5.8 Server, vi is the default command line
editor, I have a line on each users .kshrc profile as follows:
export EDITOR=/bin/vi
I want to use vim as the command line editor, the below line
doesn't work
export EDITOR=/bin/vim
Thank you (1 Reply)
:1,10 s/yes/no/g
this ex command will substitute yes with no everytime it is found within the first 10 lines of the file.
:s/yes/no/g
this ex command will substitute yes with no everytime it is found for the line where the cursor is on
my question is how could this substitution be... (4 Replies)