General :: Deleting Several Lines In Vim?

Mar 5, 2011

I've a big text, and I would like to delete several lines in vim. I was thinking in doing that with marks, but I can't do it. Below it's an example text and I want to delete from <FROM HERE> to <TO HERE>. How can I do that?
[Quote] .....

View 3 Replies


ADVERTISEMENT

General :: Conditionally Deleting Lines From File

Mar 10, 2011

I am facing some problem regarding deletion of a line from a text file. The file consists of the lines of type which consists of more than 6 occurrences of : character in it. The line should be deleted completely and the line next to it must be shifted up.

View 1 Replies View Related

General :: Deleting Lines From Text Files

Sep 17, 2009

Is there anyway to delete certain paragraphs within a text file and then insert the paragraph into another text file.I just cannot figure out how to remove the specific lines from the file and then insert them into another file at a certain line within that new file. Thanks again

View 10 Replies View Related

General :: Deleting First Line With Unique String Then All Subsequent Lines Thereafter?

Jan 20, 2011

I am doing molecular dynamics where I have to edit files. I have looked at tutorials for grep and sed but can't find my solution. The files produced in my simulations look something like this:

ATOM 1825 NE2 GLN 112 113.646 27.895 14.456
ATOM 1826 HE21 GLN 112 114.020 26.957 14.490
ATOM 1827 HE22 GLN 112 112.649 28.039 14.388

[code]...

View 5 Replies View Related

Programming :: Deleting Lines Above And Below A Word

Mar 25, 2011

i jst want to delete a host entry from httpd.conf the entry for lal.com should be deleted!!

View 14 Replies View Related

Programming :: Deleting Lines From A File With Specific Pattern Using AWK?

Jun 6, 2010

I have a file which contains milion of records. It contains 12 columns seperated by "||" (delimeter).

First two fields contain first name and last name of a person. Now my requirement is to delete all those records from this file for which:

First two fields does not contain any alphabet.

For e.g i have below mentioned records in file:

gaurav||gandhi||123||456||789
#a%bcd||123abc||89|90||91
12345||@@@||89||123||234
***||!!!!||98||76||90

Now, last two lines should be removed from this file since first two fields does not contain any alphabet for these two records.

View 12 Replies View Related

Programming :: Deleting Multiple Lines Above And Below Expression In File

May 19, 2010

I have a very, very large log file (360MB) that I'm trying to thin out. As it turns out the majority of this file has entries that aren't necessary so I'm attempting to build a command that will strip these out. The following command works to display only the data that I do not want:

Code:
cat xml_results.log | grep -B 6 -A 5 "YYY ZZZ"

This displays exactly the data I want to delete from the file by displaying the expression and six lines above it and five lines below it. However I'm at a loss as to how to remove this data from the output and display everything else. I looked into the -v option with grep redirecting the output to a new file:

Code:
cat xml_results.log | grep -B 6 -A 5 -v "YYY ZZZ" > xml_filtered_results.log

However it doesn't work, the new file is the same size as the old one. What am I doing wrong? Is there a better method of doing this? I'm a bit out of my element since the method I'd normally use can't handle files of this size.

View 7 Replies View Related

General :: Delete All Lines Containing A String, Plus 4 Lines Below It?

Jan 26, 2010

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 Related

OpenSUSE :: Web - Screen Loads And After Initial First Few Lines Breaks Up Into Multiple Repetitions Of Lines

Apr 22, 2011

I 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]...

View 1 Replies View Related

Ubuntu :: Wobbly Windows Lines - Get These Lines When Drag/move The Window Upwards

May 31, 2011

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

Programming :: Remove Lines And Parts Of Lines From Python Strings?

Nov 24, 2009

How do you remove parts of strings using python? Such as, if I have something like:

Code:
erme1 sdifskenklsd
erme2 sdfjksliel

[code]....

View 3 Replies View Related

General :: Replace Several Lines In A File With Other Lines In Another File?

Oct 26, 2009

I have this massive table file with some data in it and I want to replace some lines that are wrong with the correct ones that are in another table file of the same format. The wrong lines are not all together in a block but randomly distributed so I need to make a loop checking if the line is in the other file and if it is, replace it. I want to try and do it with sed or awk but I don't really know how to....

View 12 Replies View Related

General :: Deleting Everything: # Rm -rf /

Aug 23, 2010

Just wondering, what happens when you delete every single file on a running Linux system?

# rm -rf /

View 3 Replies View Related

General :: Deleting Another User's Diretories From Own?

Apr 12, 2010

I am a non-root user, and have made a directory into which other users in my group can write. The directory is setgid, so files and directories within it have the same group.I can delete files placed into this directory, but if a user creates a subdirectory with files in it, I can't seem to delete those. Is there something special I can do (other than, say, bothering the user in question or the sysadmin about it) to get rid of this subdirectory?

EDIT: Inevitably, of course, someone asks "why?"The shared folder in question is a mercurial repository. We can't use a shared-account ssh-key-based server for this like mercurial-server, and we can't just host it externally for various reasons. But that part works fine.We use Redmine for project management, but it does not yet read the repo index for file contents - it reads the working directory. So the working directory must be kept up-to-datecrontab has been disabled by the sysadmin, so that's out. So I naïvely put a changeset hook in the shared repo that performed an "hg update". This seemed to work fine initially, until, of course, someone pushed a commit with a new directory. While I had vague thoughts of trying to make a setuid script for the hook, I'll probably just consider safer avenues.

View 1 Replies View Related

General :: Windows 7 - After Deleting Partitions?

May 16, 2011

I have a laptop that I was dual booting with Windows 7 and Ubuntu. I used the MSFT disk manager to delete the partitions. I made sure my windows live cd was working, which it was, before doing this. But now, when I boot my computer, it won't run the cd. All I get is

error: no such partition. and then a command prompt: grub rescue>

I made sure my boot priority was set to boot from the CD first.

View 2 Replies View Related

General :: Deleting Iframes From Files

Apr 25, 2009

my website was recently infected with this stupid malware lotultimatebet .cn...there is a hidden iframe on almost all the 6000 pages of my site.can you please advise, if it is possible for me to remove this line from all pages by executing some command?

View 1 Replies View Related

General :: Deleting A File Beginning With '?'

Jan 26, 2010

I have found a file beginning with a question mark in my home dir, not sure how the hell it got there. It's from a downloaded rar i think.

Does anyone know how to do this?

View 14 Replies View Related

General :: Deleting A Line Containing The Word?

Jun 10, 2010

what would be the syntax to delete a line containg the word "word" from the file "file" i want to delete the whole line and not only the word...

View 6 Replies View Related

General :: Deleting All Files From Directory Except For Two

Nov 25, 2010

I'm writing a Perl script which performs linux commands.I have a directory with a load of files.

Code:exec_cmd('rm $(ls * | grep -v file1)');
This command will delete all except for file1. How can I modify this to delete all files except for file1 & file2?

View 2 Replies View Related

General :: Deleting Files By Date

Nov 5, 2009

I had a program run riot and it has created hundreds of spurious files in one directory. Fortunately they are all dated 4th November so are easily identified. What bash command can I use from the console to delete them all?

View 2 Replies View Related

General :: Extracting And Then Deleting Archives?

Apr 23, 2011

I have a large number of zip-archives which I would like to extract and then delete, keeping only the extracted files. The files are located in a number of directories and I issued the following command, hoping that it would solve my problem (which it didn't):

Code:find . -name "*.zip" -execdir unzip '{}' ; -deleteWhat happened was that find continued to extract the files as intended, but then it deletednot only the zip-archives but also the newly extracted files.it only affected a portion of the files that I had already backed up.I don't have enough space on my hard drive to extract all the files without simultaneously removing any data and I don't have the energy to go through all the directories one by one manually. Surely there must be a better way. Is there a way to fix the code snippet above so that it works as I intended or is there a better way of doing this?

View 4 Replies View Related

General :: Preventing Deleting Of Directory?

Jun 14, 2011

i need to restrict access of deleting to directory and partitions os disk? how do i do it?

View 5 Replies View Related

General :: Process Works After Deleting It?

Jun 1, 2010

If I delete some program, let's say - PulseAudio, it still runs and I need to kill this process. Why? How can it work if it's no more on the HDD? And if I just reboot the PC after deleting PulseAudio (without killing it), it won't be in memory then?

View 6 Replies View Related

General :: Recover From Deleting Partition

Apr 4, 2010

I have deleted the ubuntu partition on my xp pc. Now at restart i have the following:
GRUB loading.
error: no such partition
grub rescue>
I have no idea what to do now. I have downloaded super grub - because one of the pages that i googled said it would help - but my pc does not read from either the cd or usb drives - don't know why.I need this pc recovered today .

View 6 Replies View Related

General :: Vista Not Booting After Deleting Partition

May 26, 2010

My cousin just deleted his Linux partition and another smaller partitio nand now Windows is not booting, no he does not have the recovery disc. When Windows tries to boot it goes to "GRUB" and says "partition not loaded". What are some GRUB commands? And is it possible to fix this without using the recovery CD?

View 1 Replies View Related

General :: Does RSA Authentication Work After Deleting Private Key?

Feb 14, 2011

I was testing my authorized_hosts setup, so deleted my local private key. I then successfully ssh'd into my remote server using RSA authentication. I was expecting to get a permission denied, seeing as there is no longer a private key to guarantee I'm me. Guessing I'm misunderstanding something fundamental. Anyone know what's going on? It doesn't look like ssh-add is holding my private key:jake@clyde:~$ sudo pkill -9 ssh-agent

View 2 Replies View Related

General :: Rsync Not Deleting Files On Target

Sep 8, 2010

I'm using the command below to sync two directories. Problem is insted of deleting the files on the target directory it simply appends a ~ character at the end of the file name. Not sure why this is happening?I'd like to have all deletes on the source replicated on target.

View 2 Replies View Related

General :: Automatically Deleting The Directory In RedHat 5?

Feb 21, 2010

Something strange is happening with RedHat Linux 5. I created one directory system_verilog twice and both the times somehow it's get deleted after next booting of machine (after modification of some of the file in this directory).

View 3 Replies View Related

General :: Deleting A Specific Line Which Contains 2 Patterns?

Apr 7, 2011

i have a problem about deleting a line from a text file which contains two specific patterns. i am using "sed -i "/$name/ d" peop.txt" but i must use one more variable which is surname.

"
burak:ak:3242:2342:dsa@a.com
gokhan:an:432:4234:da@a.com
"

and this is the code of text file. and the second question when i use "/$name/ d" it deletes not only the names which are macthing with $name but also all words that contain $name. so how can i fix these problems_?

View 2 Replies View Related

General :: Deleting Files Older Than 1 Hours

Sep 8, 2009

on my site now I'm using cache and need me cron script that will delete files older than 1 hour I have feature in my kloxo control panel just need me the command .

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved