Programming :: Check For Word Frequency In 1 Column

Jul 6, 2010

I have a large tab delimited text file, about 17gb. It only has 6 column. On column number 4, it is all numbers. Ranging from 1-1000. I want to count how many times each number occured. So the output I want is in 2 columns, first one is a number, second column is how many times it occured. I tried

head -n 1000 coverage | cut -f 4 | uniq -c

Didn't work for me, the first column returned is not unique.

View 3 Replies


Programming :: Change To Capital First Letter Of Every Word Over Specific Column

May 1, 2010

Trying to change to upper case first letter of every word over a specific column.

View 10 Replies View Related

Programming :: Check Command Line For A Word?

May 23, 2010

I'm building a script for my place of employment. The next step in it is checking what the user input was. Determining if they added a part in there or not. The script prompts for a hostname. Hostnames are localhost.localdomain. Now, I want the script to check to see if they put localdomain and if they did, not to add the domain to the /etc/sysconfig/network, but just what they entered. So say the user inputs:


View 4 Replies View Related

Programming :: Awk Multiple Column Into Single Column?

Jul 15, 2010

I have a multicolumn datas, like

a1 b1 ... f1
a2 b2 ... f2
. . ... .


I would like to make a file with all these data in one column, like



Can it be done with awk or some other command? Also, is it possible then do add another column in front of this one with numbers of the lines (for every previous column), like

1 a1
2 a2
. .
. .


View 14 Replies View Related

Programming :: Read Two Files Word By Word At A Time Using Any Loop By Shell Script?

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

Programming :: Bash Shell Script Read File Word By Word?

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:

while read word
do a=$(($a+1));


View 14 Replies View Related

Programming :: Bash Read Input Word For Word ?

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


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

Ubuntu :: Startup Disk Check Frequency - GUI Control?

Dec 17, 2010

I had it in mind that Ubuntu ran disk checks every 30 boots, but mine are more frequent - running between 10 & 25, which is an irritation. Records show checks after: 12-21-10-20-10-20-13-25-16-21 boots. Should I worry about either the frequency or the variability? I found threads suggesting how to change the frequency using tune2fs, so I suppose I can try that to stretch the interval to maybe 50 or weekly? Will it have any effect, since there is so much variation already? Is there a GUI for setting this frequency, instead of fiddling in terminal?

View 2 Replies View Related

Ubuntu Multimedia :: How To Check Audio Quality (Frequency / Bits)

Sep 25, 2010

Is their any software in Linux which tells about audio sound quality (frequency,bits/s etc...?
which is special designed for all Audio_quality-features. Moreover, I have tried Themonospot software but its only for Video formats. I want soft 4 audio formats only.

View 2 Replies View Related

General :: Check Quality Of A Specific Column In A Tab-delimited File?

Mar 8, 2010

shell commands for such two goals?

In a tab-delimited file,


1. How can I find the non-unique values in the 1st column (1, in this case)?

2. How can I find the non-integer values in the 5th column (abc, in this case)?

View 3 Replies View Related

Programming :: Get Min From A Column?

Dec 8, 2010

i am new to scriptingi have a file : file.dat with following data

/storage_01 64% 0
/storage_02 17% 1


View 4 Replies View Related

Programming :: Column Statistic By Awk ?

Jan 13, 2010

Here is the txt file


I want to use a script to statistic the results like that

I want to know the the same string in the first column and how many different in the second column ?
how awk to write ?

View 7 Replies View Related

Programming :: Postgresql Put '' In Column?

Apr 9, 2010

Problem is simple but I can't figure out how to solve it, I tried any possible way that I know but with no result.I'm using simple perl script with DBI and do select from one table and do update in other table with results from select, but I can't preserve my '' returned from select when doing update. I simply want my '' from first table to be '' in second but postgres makes them real new lines. I tried to escape '' with , '',"",E(I mean E'value here') in front of value that updating but they are always real new lines not '' in new table.

View 2 Replies View Related

Programming :: Check Menu & Check List In Utility Dialog?

Aug 19, 2010

I want to put check menu & check list in utility dialog.i dont know how i do this

View 1 Replies View Related

Programming :: Algorithm For Binary Frequency Search?

Jul 16, 2010

I've got a bit of an obscure question for you to test your brains a wee bit. I'm trying to implement a search program to find areas of high density in a binary string.




Where density is the number of 1's / number of digits with a maximum number of digits being the current number in a buffer (in this example 50). So for the example the density for the whole buffer is 15/50. But the density of Buffer[14..20]=[1110001]=4/7. So if looking for areas of density = 1/3 it would find the longest sequences of density over 1/3.So in the example. Buffer[4..9]=[100101]=3/6=1/2 which is above 1/3 but it is within the Buffer[4..48]=[100101000011100010000001000100100001001011001]=15/45=1/3

View 5 Replies View Related

Programming :: Bash Awk Column To End Of File?

Sep 4, 2010


ls -lhGg | while read line; do echo "$line"; done | awk ' { print $3" "$6 } '

what i want to do is be able to print column 3 and every column greater then 5. Has to be to the end of the line, since different filenames can have different amounts of words in them and the blank space is the separator. my current code works just fine if the file has no blank space.

View 8 Replies View Related

Programming :: Cut Column An Edit Data?

Mar 26, 2011

Mar 26 12:32:53 name sshd[3261]: 27 12:42:53 name sshd[3262]:
how to make this data in output as:

"Mar 26 12:32:53","name","sshd",""
"Mar 27 12:42:53","name","sshd",""

View 6 Replies View Related

Programming :: Add A Column To A Text File?

Apr 28, 2011

I have a text field that is just list of servers and I need to add the word hostname in front of them... It must be brain fart but I can't think of how to do this. Basically I need this:


To this:

hostname server1
hostname server2
hostname server3

(And I just mean simply the word "hostname")

View 2 Replies View Related

Programming :: Sed To Search And Insert Column?

Feb 24, 2011

I have the following file.

B0 49.2230869 -102.5743868
C 1LPRK 654.90
C 1PREU 3693.90
C 1JRSU 3693.90


I need to insert text ABCDEF starting at position 26 if a line starts with C. I need it to look like:

C 1VKNG ABCDEF 3097.00
C 1JLFU ABCDEF 3157.20
C 1MNVL ABCDEF 3346.10

I would prefer to use sed to do this and not perl.

View 14 Replies View Related

Programming :: Transposing Only Part Of Row Into Column?

Jul 8, 2011

I am trying to transpose the following row:

x1 x2 x3 x4


x1 X2
x3 x4

With tr '''' < file I can select all columns to become separate rows,but as you see x3 and x4 have to be grouped when transposing.Or should I use awk for this one?

View 1 Replies View Related

General :: Calculate 3rd Column Which Should Be Addition Of Value In 1 And 2nd Column?

Jul 19, 2010

How would i calculate following values.Initial file

10 3
20 4
How would i calculate 3rd column which should be addition of value in 1 and 2nd column.File after calculation
10 3 13
20 4 24

View 14 Replies View Related

Programming :: Calculate Data And Make It Into New Column Using Awk?

May 24, 2011

i've been using a awk script to calculate my data... i have 3 files:

file a1.txt:



the results were (3.5, 6 and 3) which is pretty easy.. now i want to combine all this into 1 file and each have different columns and called it avg.txt which have something like this in the end:

3.5 6 3

View 1 Replies View Related

Programming :: C - Adding Up Array Column Total?

Jan 25, 2010

I'm having problems adding up column totals using arrays. I've got it to add up the row totals and display at the end of the row. Here is my code so far


#include <stdio.h>
#include <string.h>
const int maxrows=10;


What i need it to do is, add up the columns and display it at the bottom of each column similar to how the row totals display

View 2 Replies View Related

Programming :: Find The Average Of First 12 Numbers In The Third Column Using 'awk'

Nov 20, 2010

I have a text file with 4 columns and 18 rows. All are integers. I wish to find the average of first 12 numbers in the third column using 'awk'.

View 8 Replies View Related

Programming :: Perl Extract Information For A Particular Column?

Oct 24, 2010

I have a file which has the output as shown below:


Teams | matches |Goals | YC | RC
Liverpool: | | | |
Gerrard | 97 | 100 | 41665 | 1342


I need to extract the Info from the RC column for the first 4 players of liverpool. The test code i have does the same,but can anyone show me a better way of doing it.I could do it easily with gawk -F"|" and print the respective column,but i need to do this in perl.


use strict;
use warnings;


View 7 Replies View Related

Programming :: Remove Duplicate Entries From First Column?

May 12, 2010

I have a huge (over 10 gb) file with a list of IP's each followed by a corresponding number like this:

Code: 10 11 12 13 14
and so on..

I'm trying to sort this file numerically and weed out any duplicate IP addresses. How do I do this on bash? I have come up with this but obviously it does'nt work.


$sort -n myfile.txt | cut -f1 | uniq -u

View 2 Replies View Related

Programming :: Script To Change Column Data?

May 14, 2010

i have a compiled data as follows:



View 13 Replies View Related

Programming :: Search A String And Print Column?

Mar 13, 2010

I need to search a string which is in the first line and print that column.

For e.g

$ top -bn1 | head -20 | awk '/PID/,/*/'
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 13737 admin 15 0 2476 936 680 R 2 0.0 0:00.01


View 6 Replies View Related

Programming :: PHP - Sorting Multi Dimensional Arrays By One Column

Mar 17, 2009

I just started programming in PHP so I haven't figured out how to do this yet, but I have a multi-dimensional array that I need to sort by one column. That's fine...but I need the sort to ignore case! Right now I have it sorted by 'name' (the other column is 'uid').

The problem is that by the default the sort is case-sensitive so the array looks like this:
Apple 4015
Banana 4011
Cherry 4045
avocado 4046

I want to be able to sort the the 'name' column in a case-insensitive manner so that the array actually looks like:
Apple 4015
avocado 4046
Banana 4011
Cherry 4045

How to accomplish this? Just FYI I'm not actually sorting the PLUs for fruits...but it was a simple example. I'm actually doing this for a Facebook application.

View 2 Replies View Related

Programming :: Script To Read A File And Get Each Column With Varibles?

Jul 2, 2010

i have a script to read a file and get each column with varibles.actually my file: hplog1 sample 3 lines consists of

client1_day- 2010
client2 2009


View 1 Replies View Related

Copyrights 2005-15, All rights reserved