General :: Inserting Same Word On Different Lines In Vi
Aug 2, 2011I am having problem in adding a word in same place on different line in vi editor (/bin/bash).
View 4 RepliesI am having problem in adding a word in same place on different line in vi editor (/bin/bash).
View 4 RepliesI have a large file in which each line has three or more blank-delimited words. I'd like to code a grep to keep only those lines which have the letter M in the last word. the M (if present) will be the first character in the last word.
View 14 Replies View RelatedI need to replace part of a line in a file with multiple lines, however need to separate each line with a newline is this possible?
Example, need to remove line 2
And insert line similar to below:
If the multiple lines were part of a text file, would inserting a text file automatically include newline characters?
i jst want to delete a host entry from httpd.conf the entry for lal.com should be deleted!!
View 14 Replies View Relatedthis is driving me crazy. How can i in the terminal, display only the first 5 lines of say dmesg
View 7 Replies View RelatedI am trying to find a way to search a text file for a certain keyword and then select each line containing the word , copy and paste these lines into another text file. I can do this easily with UltraEdit but I cannot figure out how to do it in Jedit or Scite.
View 5 Replies View RelatedI took all my docs of my pc and put them on a usb drive and now have moved them onto ubuntu. However, when I open them with openoffice, all it brings up is lines and lines like this... how I can fix this and get my documents back to normal again?
View 3 Replies View RelatedI need to chop of the top 30ish lines of several log files until a line starting with "Initialization completed."The trouble is that it's not always the same amount of lines that need to be deleted, and they don't always contain the same information, which is why I would need to delete everything priorhe line starting with "Initialization completed."Right now I have a little script I wrote based on looping each file through several "grep -v" commands with each known pattern of lines I want to ignore, but it is tedious and I have to inspect each file afterwards to make sure nothing is left from above "Initialization completed
View 3 Replies View RelatedI have an old-address-list file which is having around 1500 entries. I need to convert this addresses in to a specific format.
The old-address-list file>
# cat old-address-list-file
dn: CN=Muhammad Hadhi K.M,OU=IT Dept,OU=Example Company H.O,DC=example,DC=com
cn: Muhammad Hadhi K.M
[code]....
Want to search for ~ and delete it as well as to append the entire line to the above line. For Ex:
1111xxxx date Sandy area is ~around this area.3222xxx date There seems to ~left side of map, the colours are accurate (showing green areas)Even if I ~zoom in, the green parks, xxx3258 date The dammed up
~away, the "other" body of water varies ~blackNatural gas leaching.
IT MUST LOOK LIKE:
1111xxxx date Sandy area is around this area. 3222xxx date There seems to left side of map, the colours are accurate (showing green areas)Even if I zoom in, the green parks, xxx3258 date The dammed up away, the "other" body of water varies blackNatural gas leaching.
I have to modify formsweb.cfg file in Oracle IAS.
Problem description
In formsweb.cfg file are two lines with labels archive_jini= and archive= at the beginning of line. After equal sign (=) is row of filenames of java archives delimited by coma(,). When I insert a new jar file in java directory, I have to append the very same name of jar file to both lines if that name is not yet present.
Example snippet from formsweb.cfg
Well, I am facing one issue:How can i read two files word by word at a time using any loop as i need word by word comparision in shell script?Please let me know pseudo code.
View 14 Replies View RelatedI have a output file look like this:
{"test1" : "test2", "test3" : "test4"},
How can I read word by word in each line?This is not working code:
a=0
while read word
do a=$(($a+1));
[code]...
I've come across an unusual requirement for a service in my Ubuntu system.Simply put, I need to find a way to search for all instances of a term in a file, delete lines containing containing that term, and delete four lines below each instance of that term. ither that, or copy the entirety of a file to a new file and skip over all lines containing the term plus four below it.This sounds kinda weird, I know. Without going too far into detail, I either have to change the logfile format for a server I'm running which is a huge pain in the butt, or I can just run a script to edit an HTML report generated from said logs. (Said report is really just for managers to peruse, and I like my log format, so I'm pursuing option 2.)
View 4 Replies View RelatedIn linux is there a way to find the next word of a particular word of a file. grep displays entire line of the particular word. But i want only the exact next word of that particular word.is there any command for that.
View 13 Replies View RelatedI am pretty new to bash scripting...I am trying to write a script that will take an input and read it word for word and then DO something with it like echo. I have been able to find how to read word for word from a file but I don't know how to do it with input.
I was looking for something like
Code:
exit 0 The input would be A-Z a-z 0-9 and have a single space between each word.
I am having a problem while inserting a particular module.
Following are some prints :-
I am using STLinux-2.4 Distribution, kernel 2.6
I have changed the access permissions on all the .ko as rwx. Still I am getting the problem.
What command is executed when you plug in a USB Flash drive manually in the PC's USB port?I am pluggin in the device and it is automatically getting mounted in /media/ed7a753f-df88-4984-b65a-5d3a8cc2714a. After I unmount the device using umount /media/ed7a753f-df88-4984-b65a-5d3a8cc2714a, how do I remount it from the terminal so that the weird directory gets created automatically and the Flash Drive gets mounted there?Another question, where does the system get this ed7a753f-df88-4984-b65a-5d3a8cc2714a. Is it some kind of identification of the disk?
View 6 Replies View RelatedI am using Debian testing with KDE 4.6.5. However, when I insert my ubs stick, on top of the expected kde response I get a Nautilus window popping up (which is the Gnome file manager). How can I disable this?
View 1 Replies View RelatedI've down loaded mysql database file and now I'm looking at adding it into a new dedicated server. Should I upload that sql file to the root folder I created for the domain and insert it with shh like that? If not where should I upload this mysql file to insert it to the new database. It's rather large so I have to use SHH Fir example if this is the code,
Code:
mysql -uUSERNAME -pPASSWORD DATABASENAME < MYDATABASE.sql
where is that actual location of MYDATABASE.sql
I want to insert a picture into a group of pictures (I memorized their names in a text file) resulting a new group of picture (which I also memorized their name in another text file), but I have a problem doing that. I want to write something like that:
$> cat file1 | cat file2 | xargs composite -blend 30 text.jpg line_file1 line_file2
where
file1 is:
frame1.jpg
frame2.jpg
frame3.jpg
....
and file2 is:
new_frame1.jpg
new_frame2.jpg
new_frame3.jpg
...
I have about 200k data entries in xml file. I wrote php script (using php-xml) to read xml file and insert into mysql. At first it went really quickly inserting, then after a while after inserting 100k entries, it slowed right down, just like it would not even doing anything. I have CentOs with 512M on VirtualBox running as server.
View 3 Replies View Relatedi installed opensuse 11.3 on sda6 and linux mint 10 on sda8
currently the grub2 appears at start of system and there is no entry for opensuse 11.3
i didn't installed the grub bootloader at time of opensuse installation as then i would be having grub and grub2 both
please tell how to insert the entry of opensuse in grub 2 ?
i want to know which files are to be edited and what has to be inserted to accomplish this task ?
When inserting/removing a usb device to a board based on linux system, an output is given:
Code:
# mmc1: card 0001 removed
mmc1: new SD card at address 0001
[code]...
I am using ubuntu and mysql.I have a list of many .sql files, like 1.sql, 2.sql, 3.sql ... 100000.sqlI need to insert them into the database mysql mydb < *.sqlGives me: -bash: *.sql: ambiguous redirect
View 2 Replies View RelatedWhy would rsync insert a user's home directory path in variable expansion when run via cron, but not when run manually. The gory details... Red Hat Enterprise Linux AS release 4 (Nahant Update 6) Linux 2.6.9-67.0.20.ELsmp The script (parts anyway, and simplified)...
Quote:
#!/bin/bash
. /home/bea/.bash_profile
echo rsyncloc=${rsyncloc} >> ${log}
[code]....
So I am new to ubuntu and am trying to work with "iptables". I have ubuntu version 10.04, in the terminal I try to create a new iptable by writing: iptables -N chain but the response is: FATAL: Error inserting ip_tables......... also it says "you must be root", what does root mean?
View 2 Replies View RelatedJust using shell scripting, how can I insert text into the middle of a file name. The file has a predictable pattern, let's say 3 letters and 3 numbers and I want to insert text in the middle of those 2 patterns. Say ABC123 is the file name. As a result, the file name should be ABC.blah.123
View 2 Replies View RelatedI have been experiencing a problem where the screen loads and after initial first few lines breaks up into multiple repetitions of lines. Reloading helps but has to be repeated when pageing down. Mail is no problem; it is supplied by my network provider. OS is openSUSE 11.2 which I update when advised. Below is a sample from the error console:
[Code]...
I've just installed Kubuntu 11.04, switched on wobbly windows effect. It runs very smooth on my Nvidia GeForce 7600 GS with dual screen twinview turned on. However, I get these lines when I drag/move the window upwards - see screenshot:
View 6 Replies View Related