How to remove line of text from file
location: linuxquestions.com - date: May 23, 2003
I wonder if there's a linux command which will be able to remove
a whole line of text from a file given a certain phrase
I know I can do a
cat filename|grep phrase
but that will only display the whole line of text.
How do I erase that whole line of text and save the changes
back to that file ?
Remove line breaks from plain text
location: ubuntuforums.com - date: April 22, 2009
I would like to remove all line breaks from a block of plain text.
Project Gutenberg plain text (.txt) files contain line breaks, such that they don't display correctly on my media player. An short example of the text formatting is attached.
I would be happy to lose paragraphing to gain continuous sentences (bonus points for retaining paragraph breaks i.e double line breaks )
I don't have a great number of individual files to fix, so would be happy with any solution (command line, script or otherwise) that works.
The closest I found involved using fmt, however the instructions and man page didn't provide enough detail for me experiment with confidence.
How to extract text from log file Apache 12.04
location: ubuntuforums.com - date: October 31, 2013
I don't know whether I am posting this in the right section, so my apologies if I placed it in the wrong section.
There is a lot of information in the error.log and access.log from the Apache logs.
Most of the time I am only interested in only a certrain type of log entry.
My question is how can I extract a certain type of entry/sentence and extract it to another text file?
For example, copy all 404 access attempts to a text file?
I am new to Linux and have no clue where to begin...
Thanks in advance!
How to substitute text from a line in bash
location: linuxexchange.com - date: November 2, 2014
I have txt file like this one:
Linux Mint 17
Debian GNU/Linux 7.0
Slackware Linux 14.1
I need to take version numbers and put it to the beginning of a line.
How to extract text from a PSD file?
location: linuxexchange.com - date: July 7, 2009
I need to extract the text from the layers in a photoshop PSD file on linux. Does anyone know how to do that? Gimp rasterizes the text and you can't copy and paste it. Also, note that I do not own the Photoshop program.
remove text from file
location: linuxexchange.com - date: June 10, 2013
I want to remove some text from file1.txt.
I put the text in the file tmp and do:
grep -f tmp file.txt
But it gives me only the difference.
The question is how to remove the difference from file.txt.
How do I Remove Specific Characters From File Names Using BASH
location: linuxexchange.com - date: September 30, 2009
I have a lot of files that have a shared pattern in their name that I would like to remove. For example I have the files, "a_file000.tga" and "another_file000.tga". I would like to do an operation on those files that would remove the pattern "000" from their names resulting in the new names, "a_file.tga" and "another_file.tga".
Linux remove text from file
location: linuxexchange.com - date: February 25, 2013
I want to write a command with removes an item from a file .todolist like that:
if [ "$task" == "- " ];
cat $path | grep -v $1 > $path
When I cat $path | grep -v $1 all works perfect but when I try writing back to the file it leaves the file empty. What am I doing wrong?
command or shell script to print line range from file
location: linuxquestions.com - date: December 28, 2005
i need a script or command to print range of line from a specified file
$ [command] 10 20 file
This should display line numbers from 10 to 20 from the file.
Thanks in advance.
Remove last character from file/string
location: linuxquestions.com - date: July 21, 2005
I've got a file that is comma delimited, such as;
The problem I'm facing is I want to remove just the last comma such that the file retains all number and commas minus the last one. I am brain farting after GOOGLING all night .... I saw much reference to 'chomp' and 'chop' using PERL, but I'm trying to keep this very simple.
Is there a command in Linux that can be used or included in a simple script to remove this last character (the comma) from the file?
Any information or pointers are greatly appreciated!!!
Page: 1 2 3 4 5 6 7 8 9 10