Ubuntu :: Select Lines Containing Word And Copy To Another File?
May 31, 2011
I 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
ADVERTISEMENT
Mar 6, 2011
I 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 Related
Jul 7, 2011
I 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 Related
Jul 20, 2010
I have a file that contains 100 ligns, i need to write a script that read 70 lignes and redirect those 70 ligns to another files and these 70ligns have to be erased in the first file
when i write this command
head -70 somefile.txt>test.txt
or
sed -n 70p somefile.txt>test.txt
i have these 70 lines in the text.txt files
but these 70 lines have to be deleted inthe first file somefile.txt
View 1 Replies
View Related
Aug 25, 2010
I've been trying to sort this out for several hours and I?m totally lost? I?ve been searching around, but haven?t found the solution to my problem. I have a directory with 100 files. I need to copy 10 lines of each files (let?s say from line 45 to 55) into one unique file. So I guess I could use sed ?w, but I didn?t manage to write the right script. I also tried using a loop to create 100 different files, each one with the 10 lines) to concatenate them later on. But I only got 1 file, not 100.
View 12 Replies
View Related
Jul 27, 2011
A function by name abc is called in many files. I want to copy all the lines with the function call to an output file.A simple grep on function name doesn't help me as the function call is spanning across multiple lines as follows:
abc(parameter1,
parameter2,
parameter3);
So I want to copy all the three lines (till semicolon) to the output file.The problem is because there are more than 200 calls for the same function and I cannot do it manually
View 2 Replies
View Related
Feb 17, 2010
this is driving me crazy. How can i in the terminal, display only the first 5 lines of say dmesg
View 7 Replies
View Related
Jan 21, 2011
I 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]...
View 14 Replies
View Related
Aug 2, 2011
I am having problem in adding a word in same place on different line in vi editor (/bin/bash).
View 4 Replies
View Related
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
Jul 19, 2011
I 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 Related
Feb 19, 2010
I downloaded a mouse theme form gnome look and installed it in the themes. But it has not appeared in the pointer themes section in custimation even though it said that it is installed correctly.When I drag the file to install it again it says something along the lines of it cannot copy a directory over a directory.Where can I find where the mouse/pointer theme is located and delete it. I have searched filesystem, google and these forums and not had any luck yet.
View 1 Replies
View Related
Jan 17, 2009
I 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]....
View 6 Replies
View Related
Feb 11, 2011
I want to select lines from FileA based on a key field in FileB.
egrep does this nicely:
"egrep -w '0132874|0132880|0100765' < " FileA
Suppose FileB consists of three lines:
0132874
0132880
0100765
Is there a way to code egrep to do the selection? I really like code which does not use explicit loops so my interest is to find a grep or egrep or sed (or some other) command to perform this function.
Neither file is sorted on the key field but they could be. There is no requirement to keep the files in their present order.We may assume that each key value in each file is unique.
View 2 Replies
View Related
Mar 28, 2010
How to copy text from vmware from linux text terminal in to word document in windows?
View 14 Replies
View Related
May 5, 2011
Ubuntu 11.04Adobe Reader 9I can't highlight/select text and copy and paste it to another file. It worked for me on previous version. Please advise how to make it.After installing OpenOffice pdf extension on LibreWrite I can import .pdf but still I can't find the select/copy/paste functions.
View 9 Replies
View Related
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
Jul 13, 2010
I've a webserver with a lot of documentary to serve. Some of the users have problems with the new microsoft documents like docx. Internet explorer 7 want to open the file like a zip-file not as word document. I've googelt around and found a solution that didn't work for me: [URL] I've added at /etc/mime.types
[Code]....
After a restart of httpd , nothing chance, always the same failure with internet explorer 7.
View 4 Replies
View Related
Jun 14, 2011
Is it possible to use the keyboard in order to select some text in the terminal windows that is not in the currently edited line? (for example, in order to copy part of previous command output).
View 3 Replies
View Related
Mar 4, 2010
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 Related
Mar 1, 2011
How to copy a Read-Only file in Linux and make the copy writable with a single cp command in Linux (Ubuntu 10.04)? The --no-preserve and --preserve seemed to be good candidates, except that they should "and" the mode flags, while what I am looking for is something that will "or" them (add +w mode).
More details: I have to import a repository from GIT to Perforce. I want that all Perforce depot files are Read-Only (that is how Perforce was designed), while all other files that were derived/copied from depot files are writable. Currently if a Makefile tries to copy a Read-Only file then the derived file will also be Read-only. This leads to build-errors when cp tries to overwrite Read-Only file second time. Of course the --force is a workaround here but then the derived file is also Read-Only. Also I do not want to mess with "chmod" after each "cp" command - I will do that only as the last resort.
View 1 Replies
View Related
Jun 28, 2011
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.
View 4 Replies
View Related
May 4, 2010
I 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.
View 2 Replies
View Related
Feb 19, 2010
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
View 2 Replies
View Related
Sep 13, 2010
I'm trying to add a word at the end of a file that already contains data. I need to do it using a single command without human interaction cause it's gonna be part of an automatic script.
View 2 Replies
View Related
Mar 4, 2010
HI am facing the strange issue in netbeans on ubuntu 9.04. whenever the file contains more than 3000 lines the characters overlap on each other and the file is not readable, where as if the file is less than 3000 lines it works fine. what may be the reason ?
View 2 Replies
View Related
Dec 7, 2009
I have an application for loading data into MySQL table using php, through excel-Reader. php is set up on the localhost and the web-page is available from: [url]
The code of xlr2.php:
When I open the page, I get the message to choose a file with the file-dialog box and the notice as:
Notice: Undefined index: action in /var/www/html/xlr/xlr2.php on line 10
Default Action:
Choose a file to Load into MySQL:
Why so? I am selecting file from ("/home/lx/myDocuments/tech/excel/smslist.xls"), but the warning says that [failed to open stream: No such file or directory in /var/www/html/xlr/xlr2.php on line 33]. A different directory than I selected.
View 1 Replies
View Related
Feb 26, 2010
I have a word file that i transfered to my ubuntu laptop, when i copied it here it was changed to a rtf file
When i try to open this file Openoffice opens up but then immediately freezes and when I click on quit it tells me openOffice is not responding. I just did an update and its still doing the same .
View 3 Replies
View Related
Nov 14, 2010
I have 2 Ubuntu machines up & running on a small network. Both are running SAMBA servers. One several years old & has a rather old version of Ubuntu. The other, quite new & has a version about 9 months old.The newest has a problem. When working with large & complex Word documents, it will periodically generate an an error on the work station.
"Word failed reading from this fille (xxx specifies file we are working on). Please restore the network connection or replace the floppy disk drive". The it crashes Word & unsaved work is lost.The error never occurs when using the old server, only the new.
View 1 Replies
View Related
Dec 8, 2010
Using the latest version of Ubuntu desktop on an emachine t5062 if it matters. I have a text file of keywords that is one-three words line after line for like 5000 lines. How would I go about adding a word to each line.Aside from typing it in or copying and pasting.If it can`t be done with Gedit I am all for using another program.
View 8 Replies
View Related