Ubuntu :: Way Of Finding Common Strings Between Two Files?
Jul 7, 2011
I have two text files in the form:1 ItemA [value]2 ItemB [value]3 ItemC [value]Some of these items are common for both files, while others are missing from either one or the other.I want to compare the values for each common item in the two lists, but don't know how. I have a vague idea that probably grep might be useful, but I don't know how to use it for this purpose.So, to sum it up, what I would like to do is to take to text files containing lists and merge their common items into a third file in the form:
1 ItemA [value_from_list1] [value_from_list2]
2 ItemB [value_from_list1] [value_from_list2]
3 ItemC [value_from_list1] [value_from_list2]
[code]....
View 2 Replies
ADVERTISEMENT
Dec 9, 2010
I've got a quick grep question. I'm trying to work out a command I can use to locate all of the files in a directory that have sql database connection details. I want to do it by looking for the strings "localhost" and the name of the database.find . -type f -exec grep -l -E '^(localhost|DATABASE_NAME)' {} ;
View 4 Replies
View Related
Jul 29, 2010
I want to search and replace strings in a file with strings in other files/i need to do it with big strings(string1 is big) and i want to use a txt file for this.But this code not working :
View 14 Replies
View Related
May 16, 2011
i have a problem in finding block of identical strings...i solved the problem in finding consecutive identical words and now i want to expand the code in order to find and remove consecutive identical block of strings... for example the awk code removing consecutive identical word is:
Code:
#!/usr/bin/awk -f
BEGIN{
RS="[[:space:]]+";
ORS=""
[Code].....
View 2 Replies
View Related
May 31, 2010
I want to extract all the common entries in the given 3 columns(fields) in the file using awk::can somebody tell me how it can be done in awk...the file is::
NC_000858.pttNC_000858.fnaNC_001403.rnt
NC_001362.pttNC_001436.fnaNC_001407.rnt
NC_001364.pttNC_001503.fnaNC_001488.rnt
[code]....
View 8 Replies
View Related
Mar 22, 2010
I would like to find all the files that contains the strings I'm searching.
For example (it's just an example), I would like to search all the files in "/etc" that contains "eth0" and "us", whatever where are located those 2 strings, the important is that the 2 strings are in the files listed.
It would be something like a "grep -lr 'eth0' *" and "grep -lr 'us' *" but in one time/command, so that I don't have to make a comparison of the 2 list of files resulting from the 2 "grep" commands given higher.
View 10 Replies
View Related
Mar 22, 2010
I was looking for a converter to use on common avi files and maybe some others and came across this thread. I followed it all the way to where it asks me to install ConvertIt by adding the repos and then running Synaptic. I found convertit and marked for install and clicked apply and got this error:
Code:
convertit:
Depends: gambas2-runtime (<2.1) but 2.13.1-1ubuntu1 is to be installed
Depends: gambas2-gb-qt (<2.1) but 2.13.1-1ubuntu1 is to be installed
So i check synaptic for that and i had them installed already from the guide. So i marked them all for reinstall since i installed them in the terminal the first time. Reinstalled and i still get the same error.
Any idea whats wrong? Or is there a better movie converter thats easier? I just want to re encode the files so the will play on my 360.
View 5 Replies
View Related
Aug 10, 2010
I ran this line: aptitude purge x11-common and all common files, all the tools I need are gone from my desktop. I have an amd64 with ubuntu +gnome on it.
Is there a way to reverse this --other than installing 1gb of packages one by one?
View 3 Replies
View Related
Feb 3, 2011
Long story short, I got a folder with nearly 800,000 php files. I would like to search each file for a string and if it exists in that file, the file gets copied to another directory. Is this possible from the terminal? So far I got: grep -i -n -r 'ppr-1792' * | cp $1 move_to_here
But this obviously doesn't work. $1 needs to be the file name that contains matching text.
View 2 Replies
View Related
Jun 4, 2011
I have installed php 5.3.6-4 on centOS 5.6. When i try to install some modules of php then it gives an error
php53-common-5.3.3-1.el5_6.1.i386 from updates has depsolving problems
--> php53-common conflicts with php-common
Error: php53-common conflicts with php-common
[code]....
I have reinstall it twice but each time i get same error.
View 6 Replies
View Related
Jul 29, 2010
what command is to be used to call strings from other files to the script and then comparing strings from two different files in the script to check if strings are matched then return the result to another script.
View 1 Replies
View Related
Aug 23, 2010
I am trying to develop a method of reading files generated by other programs. I am trying to find the most versatile approach. I have been trying bash, and have been making good progress with sed, however I was wondering if there was a "standard" approach to this sort of thing. The main features I would like to implement concern reading finding strings based on various forms of context and storing them to variables and/or arrays. Here are the most general tasks:
a) Read the first word(or floating point) that comes after a given string (solved in another thread)
b) Read the nth line after a given string
c) Read all text between two given strings
d) Save the output of task a), task b) or task c) (above) into an array if the "given string(s)" is/are not unique.
e)Read text between two non-unique strings i.e. text between the nth occurrence of string1 and the mth occurrence of string2
As far as I can tell, those five scripts should be able to parse just about any text pattern. I am by no means fluent in these languages. But I could use a starting point. My main concern is speed. I intend to use these scripts in a program that reads and writes hundreds of input and output files--each with a different value of some parameter(s).
The files will most likely be no more than a few dozen lines, but I can think of some applications that could generate a few hundred lines. I have the input file generator down pretty well. Parsing the output is quite a bit trickier. And, of course, the option for parallelization will be very desirable for many practical applications.
View 14 Replies
View Related
Jan 30, 2011
Code:
sudo apt-get upgrade
Lots of text (Reading database. dpkg: unrecoverable fatal error, aborting: unable to open files list file for package `grub-common': Input/output error E: Sub-process /usr/bin/dpkg returned an error code (2)
View 6 Replies
View Related
Dec 1, 2010
Whenever I try to install or remove a program, I get the following error
Code:
dpkg: warning: files list file for package `libavahi-common-data' missing, assuming package has no files currently installed.
dpkg: warning: files list file for package `libgtk2.0-common' missing, assuming package has no files currently installed.
dpkg: warning: files list file for package `libxres1' missing, assuming package has no files currently installed. (Reading database ... 55%dpkg: unrecoverable fatal error, aborting: files list file for package 'ubuntu-mono' is missing final newline E: Sub-process /usr/bin/dpkg returned an error code (2)
View 4 Replies
View Related
May 23, 2011
Is there a cc cleaner equivalent for linux to clear out tmp, internet files, etc.?
View 9 Replies
View Related
May 23, 2011
Is there a program for Ubuntu that converts AVI files to VOB files? This is the only type of file that will burn to a DVD and successfully play on my DVD player. I can use DVD Flick on Windows but I'm sure this can't be the only way. There has to be a way to get VOB files on an Ubuntu operating system.
View 4 Replies
View Related
May 1, 2010
I have is that I can't update anything at all, my update manager isn't working because I created a few internet files in my /etc/ somewhere so that I could use the internet through a wingate network and now I need to get rid of those files because I'm on a direct connection now. I'm running Intrepid Ibex. .
View 8 Replies
View Related
Jun 3, 2010
were do i get the .dev files for libx264 0.98 i think is the version it is asking for.I install the latest libx264 from git or does that install the .dev file also.
View 3 Replies
View Related
Aug 3, 2010
I have several text files that list hundreds or thousands of words each. I need to find the intersect of each of these sets. (i.e. print only lines that occur in each file) Is there a CLI utility that can do this?
View 3 Replies
View Related
Mar 12, 2011
I have a situation where a directory has about 1.5 million files in it. On an hourly basis, I want to be able to find any files that have changed in the last hour, compress them, encrypt them and then copy them to both a local backup machine and an off site backup.
Is there any kind of utility or kernel module that creates some type of log of modified files? I know I can use find, but the search for -mtime in this directory takes quite a while and will not suffice for an hourly backup.
View 3 Replies
View Related
Nov 29, 2010
To find all files recursively starting with a . (period), is the following OK:
find ./ -name '.'*
View 7 Replies
View Related
Apr 19, 2010
i am a newbie in linux ,i am writing a bash script to identify the files which are exactly 7 days ( a week old) i tried this command find /var/backup -mtime +7 -exec ls -d {} ;but this gives me even the files which are older than 7 days
[root@proxy access]# find . -mtime +7 -exec ls -d {} ;
./access.log.1.gz
./access.log.2.gz
[code]...
View 3 Replies
View Related
Apr 23, 2010
I am looking for this `struct messages_sdd_t` and I need to search through a lot of *.c files to find it.However, I can't seen to find a match as I want to exclude all the words 'struct' and 'messages_sdd_t'. As I want to search on this only 'struct messages_sdd_t' The reason for this is, as struct is used many times and I keep getting pages or search results.The directory I am searching in, has another directories so it will have to search recursively.I have been doing this without success:Code: find . -type f -name '*.c' | xargs grep 'struct messages_sdd_t'and thisCode: find . -type f -name '*.c' | xargs egrep -w 'struct|messages_sdd_t'
View 3 Replies
View Related
Aug 8, 2010
How do I find files with wildcardnames in it ?
For eg:
If i have files called, "hello123", "hello?","hello1" and "hellohoware" in the system and I want to list only the file "hello?" with the "find" command, how do I do it ?
find / -name hello? doesn't work as expected and also lists "hello1". I don't want "hello1" to be listed ...how do I list only "hello?" ?
View 1 Replies
View Related
Dec 8, 2010
Where does x2go log the time at date of client logins? or dosnt it log anything? i have searched far and wide, and even contacted the x2go dev mailing list, but i have found no answer anywhere.
View 1 Replies
View Related
Feb 16, 2010
I am doing a project related to system restore concept in linux. There i am planning to perform application wise rollback in case of failure!! Is there any way to figure out what are all the files used by an application in the system??
View 1 Replies
View Related
Jan 25, 2011
Need a software to Convert xlsx to xls files
View 3 Replies
View Related
Oct 27, 2010
i am looking for a linux program to burn some avi files i have to be able to watch them through my dvd player onto my t.v. i have tried devede and it works but the files i used were iso files and i am not sure it would work with a avi filese?
View 7 Replies
View Related
Nov 27, 2010
give me a script for copying all the files in a directory that are not directories to another directory. May be this could work:
Code:
FILE=(ls -l|grep ^-)
for i in $FILE
do
cp $i /destination/path/$FILE
done
View 14 Replies
View Related
Jan 28, 2010
I'm wondering if you can share some tips in regards to finding .conf files in programs when installing using package managers. I'm scratching my head on the fact that when you install a program through yum/apt-get, I don't know what and where the software is being installed at. In Windows, I know that when it installs an application, it goes into the Program Files directory, it's that simple.I know Linux has predefined directories for applications but sometimes it installs configuration files in /etc or some other locations in /usr which I have a tough time sifting through.
Is there a way to trace what .conf or any files for that matter which relates to what software that needs it? It's just hard for me to understand what file relates to what application at the moment. As much as I would like to learn more about Linux, this process for me takes up alot of time. I hope you can help me out on this one.
View 1 Replies
View Related