General :: Counting The Occurrence Of A Word In A Collection Of Files?
Jun 16, 2010
I am trying to find the word count of a specific word in a collection of documents, in Linux.
I have tried with grep and ack-grep in combination with wc but I can't seem to come up with a valid combination of pipes :)
View 1 Replies
ADVERTISEMENT
Aug 2, 2010
I have a file in the form below, and wish to replace each start line with an increasing number. So instead of:
Code:
start
content content
start
content content
start
[Code]....
After several searches and a bit of messing around, it's clear I'm missing something, so was wondering if anyone could offer any insight?
View 17 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
Oct 30, 2010
I used a command Code:
grep -r err_sys ./
its output is
Code:
./tcpclitime.c:err_sys("socket error");
./tcpclitime.c:err_sys("connect error");
./tcpclitime.c:err_sys("write error");
./tcpclitime.c:err_sys("shutdown error");
./tcpclitime.c:err_sys("read error, n = %d", n);
[Code].....
Is it possible some how to replace all the occurrences of word err_sys by printf.
View 1 Replies
View Related
Mar 13, 2011
I have been using Linux close to 2 years now. One thing that always bewildered me is audio support in Linux. These days I login to windows only for listening to music. After reading various blogs, i decided to give it a try in Linux with Amarok. There again I am facing a problem.
while i try to scan for music files it is not finding any files.
what I did is as follows:
Quote:
Setting --> configure Amarok --> collection --> scan
I have tried with mp3 .wma format files. While I try to add these files individually, Amarok is able to play those.
I am using Amarok 2.3.2 with KDE 4.4.5. Fedora - 12 is my flavor.
Given below is the log obtained with amarok -debug option
Quote:
TagLib: MPEG::Header:arse() -- First byte did not match MPEG synch.
TagLib: MPEG::Header:arse() -- Invalid sample rate.
TagLib: A frame of unsupported or unknown type 'TSC' has been discarded
TagLib: A frame of unsupported or unknown type 'TSC' has been discarded
TagLib: A frame of unsupported or unknown type 'TSC' has been discarded
[Code].....
View 3 Replies
View Related
Dec 20, 2010
So this is my code:
Code:
Modification of code I found here. It works, but I don't really know why.
Q1: Why is each filter hit counted only when the conditional is not true?
Q2: I've tried taking the file type, (.old), and put it into a variable for better usability, but then the script fails.
View 14 Replies
View Related
Oct 9, 2010
I'm trying to use Bash to search some directories for a word in one of documents. I've tried:
Code:
$ grep -R Brzeninski /media/disk-1/Dual_Data/
but It never returned a prompt, and i'm not sure what grep means or does.
View 1 Replies
View Related
Oct 10, 2009
i am using openSUSE 10.3 & like to use power of terminal to do tasks.I want to search all files containing word 'echo' in given folder.What should be command.
View 14 Replies
View Related
Nov 13, 2010
I'm not a newbie to Linux, but I'm a newbie to LQ. I've searched the internet for an answer to an issue I'm having with JOE, to no avail.For my editing purposes, I HATE word wrap. I've read the man page extensively and nothing I try works.
To disable word wrap, it says, simply edit the joerc file and place --wordrap in the first column. Done. It works for .pl, and it works for .c (seems to be built in for C). Bottom line, I cannot disable word wrap for all text files, or at least the ones I want to edit. Has anyone solved this?
View 2 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
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
Nov 6, 2010
i have a collection of text files for 50 gbs..i want to compress these files and store them into dvds.i want to know the present popular optimized method to compress the files.let me know masters.
View 1 Replies
View Related
Sep 19, 2010
In my application I came across a new requirement where I have to convert RTF files to Word and PDF formatted files. I am searching for an API using which my java application can able to convert the above specified formats.
View 4 Replies
View Related
Jun 2, 2011
During the past eight years I've used a number of computers with different operating systems and browsers. On each one I made a habit of using the bookmark utility of each browser and saving the bookmarks file. I never ensured the continuity of the bookmark file - with each new computer I started a new bookmark file. Even when I was reinstalling the operating system I didn't import the old bookmark file in the newly installed browser: I've always started a new bookmark file. As a result I have tens of bookmark files for Firefox (json format - some kind of xml?) and IE (html file format?) each one containing hundreds or thousands of saved links. I have also some files containing links in text format (created usually when I was using someone else computer).
I would like to be able to manage this bookmarks files by using some sort of "bookmark manager" software. The "bookmark manager" should be able to merge the bookmark files into a single collection/file. It should be able to identify and remove the duplicate entries (I have timely versions of the same bookmark file) and also it should be able to group the entries/links on categories (for example the bookmarked articles on codeproject.com should be grouped under the codeproject category). Not to mention that it should provide a search facility to quickly locate the interesting bookmarks. I couldn't find such software in ubuntu software center. Do you know something that even comes close to what I need?
View 9 Replies
View Related
Jun 15, 2010
how do i count the total number of cfiles in the project.My project is on a solaris machine what is the command that I have to run to know the total count of cfiles in the .pj folder.
View 1 Replies
View Related
Mar 6, 2010
I'm currently learning to use rsync to backup my music collection. I have a Firefox tab open to the rsync manual page(s) and have been reading man rsync and running experimental rsync operations.I've been doing this for the last 3-4 hours. I've used rsync for this purpose in the past with disastrous results. What was and is once again (due to a month and a half of file pruning) a 9000 file music collection had mysteriously grown to over 25,000 music files and 80GB of data! This was likely due to the fact that I didn't really know what I was doing with rsync and had never spent too much time learning about all the parameters, what their functions are and how they may relate to my goal.Here are the particulars:
* Source drive is a 500GB disk, /media/sata500/music/.
* Destination drive is a 250GB USB disk, /media/FreeAgent/music, connected to the same computer that houses the 500GB disk.
* I want to copy or backup files from /media/sata500/music to /media/FreeAgent/music.
* I do not want to create ANY duplicates of files that exist.
* I only want to add files to the destination drive if they are new on the source drive, like if I rip a CD and add the contents to the source. I want them copied over next time I run rsync.
Here's the rsync command in it's most recently used form, and probably very immature at this point.
Code:
rsync -t -r -vv --stats -i --log-file=/home/glenn/rsync.log /media/sata500/music/* /media/FreeAgent/music/
This appears to have copied all files and folders and I'm satisfied that my goal has been met with some success. To convince myself of this I ran the command and then once it was complete I added 2 new songs putting them in their respective folders on the source drive and ran the same command again. The resulting output was
[code]....
Two files transferred. Exactly what I want.Both folders now house 20,931 files and use 40.6GB. Identical as far as I can tell.What I'm concerned about are time stamps and play count data, etc. Anything that changes the original file. I don't want this data to cause a file to be transferred as I'm afraid that the new file will be created along side the old file of the same name thereby starting this whole music collection expansion thing all over again. I've invested a lot of time and effort to get it pruned down to where there are virtually no duplicates and albums are correct in that they contain the proper songs in the proper order.
View 14 Replies
View Related
Feb 9, 2010
I have most of my music on my hard drive in one big "Music" folder, and in Amarok this is seen as the collection. Everything is imported, works fine.
Until i change the ID3 tags of a file/album. Amarok refuses to load the new tags, and keeps displaying the old tags.
I have over 200 GB of music in that folder, some of it is badly tagged. When i realize that, i retag the files with Musicbrainz. And unless i scan the entire collection again, the new tags wont be loaded. Needless to say i can't listen to the respective album/file for hours, as the rescanning of that whole folder takes at least one hour.
View 6 Replies
View Related
Mar 28, 2010
I just wrote an html file, but somewhere on the write I lost count of the paragraphs.
In an html file paragaphs starts with <p> and ends with </p>
What I want to know is how to find the valid paragraph.
I used grep '<p>' file_name | grep -wc '</p>' . I dont know if this works.
View 7 Replies
View Related
Sep 11, 2009
I am trying to do a find/grep/wc command to find matching files, print the filename and then the word count of a specific pattern per file. Here is my best (non-working) attempt so far:
wc `find . ( -name "*.as" -o -name "*.mxml" ) -exec grep -H HeightResizableList {}` ;
View 10 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
Feb 9, 2011
In 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 Related
Dec 22, 2010
How to find a word from different files in linux ?
Is there any command like (find . / -name *****), that can search files in the system for a particular word in Linux?
View 5 Replies
View Related
Apr 7, 2011
Word Count for all files in a directory
View 1 Replies
View Related
Nov 18, 2010
I have this statement which greps .csv files. Code:my @files=grep {$_ =~ /.csv/}What about if I needed to get files with the word 'hosts' in the middle?
View 2 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
Mar 22, 2010
I have xubuntu 9.10 installed I need to access MS word/Excell files stored on a disk-on-key. My system does not seem to notice the D-O-K. I guess i need to mount the DOK and specify the MS filesystem (FAT,VFAT etc) What commands should i use. What is the necessary code in /etc/fstab so that it is mounted on boot
View 5 Replies
View Related
May 21, 2011
I need a command to find the all files which filename contains the text "SomeText" and to delete that files!From /home/movie/wp-content/uploads/this folder I have lots of files and folders .Also I need that for folders and subfolders who contains some text in folder name "someTextInFolderName"
View 13 Replies
View Related
Jun 3, 2011
I am having problems opening and printing word 97/2000 formatted documents that were saved using OpenOffice in Maverick. If I try to open one of these files in openOffice for Lucid, it causes OpenOffice to freeze every time. If I save the files in OpenOffice format and share them between Maverick and Lucid - everything works fine. Anyone know what might be causing OpenOffice in Lucid to freeze when loading word 97/2000 files?
View 5 Replies
View Related
Jun 21, 2011
The OpenOffice word processor can open and read Microsoft Word files containing XML (.docx) perfectly well, but it--or KDE--does not seem to recognize a .docx by default. To open one with OpenOffice, I have to manually tell OpenOffice to open it, by going through the "open with" option on the right-click menu and specifying soffice. That's obviously not a problem, but it's a minor curiosity. Haven't Word XML files been around long enough that KDE and OpenOffice should recognize them immediately?
I'm not quite sure which to blame this on--KDE or OpenOffice--but KDE seems more logical. And is this a small limitation of KDE 3.5? because I'm still using 3.5. (I'm trying to switch over to Trinity, but have not made the switch yet.)
View 3 Replies
View Related
Jul 19, 2010
I was using amarok fine with 10.04, upgraded to 10.10 alpha, still worked fine. Decided alpha had a few bugs I didn't like so I completely removed it, installed 10.04 from scratch again (I have two partitions, / and /home, only formatted /). Now I can't get amarok to build for me at all. It plays mp3's no problem but when I try to build my collection it pretends to (takes a few minutes but goes relatively fast compared to what it should take to build) then shows 0 songs. I've already tried deleting amarok inside of /home/user/.kde/share/apps/amarok
View 1 Replies
View Related