General :: Compare Columns Of Uneven Length?

Jan 20, 2011

I have a text file with 2 columns. Column A has 69,000 rows. Column B has 49,000 rows. Column A has our complete product list Column B has product list from Manufacturer 1 There are only certain/some rows which are common between 2 columns. and also, column B is not a subset of column A. Column A has extra entries and so does column B. I need to know, which rows from Column B, are common with Column A which rows from Column B are not common with Column A. Essentially I want to know from this list, how many of our products are from my manufacturer 1, how many does my manufacturer has which we dont carry.

How would I acheive this? My natural approach to solving this kind of obstacle is to reach for MS excel and use its lookup function, but its not working... Its taking forever and hanging up. since the file is so huge and probably my excel skills are really bad.

How can I do this from command line? I am looking for awk command if possible instead of sed since I am trying to pick up its syntax and usage etc. My thought process is, sort column A,B, for every row in A, lookup and output based on condition. Dont know if I am on the right track.

View 7 Replies


ADVERTISEMENT

General :: How To Compare Two Columns In A File

Mar 29, 2010

I am trying to write a script which compares a log file with reference file. The log file has a table, the LHS of the table are constants strings and RHS of table values changes if there are any changes in configuration.code...

Here I am looking for a script which compares test.log file ( whose RHS data-types are known prior whether it is digit or string) with test.Ref which is reference file for test.log file. It will be really helpful for me if any of you give some idea about writing this script.

View 2 Replies View Related

General :: Bash Script To Read Csv File With Multiple Length Columns

Jul 27, 2011

I've searched everywhere and I can't come up with a good solution. For each line I need to find the average, min, and max. I've seen plenty of solutions where the number of columns is fixed, unfortunately for me these lines can get pretty large. My thought was to read each line individually into an array, loop through the array and find the avg, min, and max that way but i haven't had much luck. I can read each line using a while loop but I'm having trouble with the array part, or perhaps that's not the best solution?

View 14 Replies View Related

Programming :: Script To Compare 2 Columns ?

Mar 1, 2011

Actually build a script which can monitor the "DateTimeHourMinute" in a data file.

I wanted to compare the "DateTimeHourMinute" from the 2nd column against "DateTimeHourMinute" on the 3rd column which located in the same line.

Below is the data sample:

View 7 Replies View Related

Debian Configuration :: Load Balancing Over Uneven Connections?

Jan 31, 2011

A little background: CCNA and A+ I have preformed this task on Cisco routers Linux for 5+ years, mostly with Debian (mostly casual, a few production situations) I need to setup a linux box with Load Balancing over a cable line 8mb down, 1mb up connection and a T1 line. If this isn't possible, at the very least I need Failover (which I have admittedly not researched as fully.) I know Failover is possible, but I would really love to double my upload bandwidth as we host a small website here. Is load balancing over uneven connections possible on Debian?

Side question: If I host a website, when users connect and get responses over 2 Public IP's, what would be the reaction on the users side? Would it get filtered and or blocked by a firewall?

View 2 Replies View Related

General :: Cut Multiple Columns At A Time?

Aug 18, 2010

I am having a souce file (say SOURCEFILE) as below with 5 columns and many rows.

pol name status loan address
123 aaa 21 100 RJY
234 bbb 31 200 RMY
345 ccc 21 300 SJY
456 ddd 41 400 pqr

i want to compare the file (say COMPAREFILE ) which is below :

123
345

I need the following output file (sayOUTPUTFILE) as below :

( ie for file COMPAREFILE i need column 2, column 4 ie name and loan from source file )

ie output file required is to be like below :

123 aaa 100
345 ccc 400

Till now iam using the following method.

1. cutting column 2nd column
2. again cutting 4th column
3. in third, step merging the 2nd and 4 th column.

method of writting single line command or any awk programme to do this in one step.

I need output file (say OUTPUTFILE) as below

View 1 Replies View Related

General :: Merging Columns From Different Files?

Oct 10, 2010

I have three files with the following structure:

file1
1 2 3 4
5 6 7 8

[code]...

View 4 Replies View Related

General :: Extracting Columns From Multiple Files With Awk?

Sep 22, 2010

I'd like to extract a single column from 5 different files and put them gether in an output file. I saw a similar question for 2 input files, and the line of code workd very well, the code is:awk 'NR==FNR{a[NR]=$2; next} {print a[FNR], $2}' file1 file2I added the file3, file4 and file5 at the end, but it doesn't work. Does anyone know what do I have to do?

View 5 Replies View Related

General :: Merge Columns From Multiple Files?

Dec 20, 2010

I want to merge columns (selectively) from several files and create a new file with the merge output. I saw some suggestions to use pr/paste to join the columns and then awk to pick-up the columns.

Code:
pr -m -t -s file1 file2 | gawk '{print $4,$5,$6,$1}'
But I have hundreds of files and I cannot manually pick up columns using awk as given in

[code]....

View 14 Replies View Related

General :: Transform Rows Into Columns In Bash

Jul 29, 2011

I would like to transform rows into columns from a file in bash.

View 4 Replies View Related

General :: Limit Unix Top Command Columns Via Arguments

Jun 2, 2010

I'm pretty sure this is super simple, but I've searched and searched and for the life of me I can't find any info on how to limit the columns that display in the interactive top program with arguments passed from the command line. I recall seeing something formatted like this ...

~/top -f (kdx)

Which would only show the %CPU, UID, program name fields/columns. I'd like to display the results in a really narrow terminal window on the right side of my desktop.

View 5 Replies View Related

General :: Memorize The System IRQs Number Columns 0-15?

Mar 20, 2011

I'M working my way through Trainsignal's CompTIA Linux + Training course and I have a question about IRQs. According to the lesson using the command "cat /proc/interrupts", I need to memorize the system IRQs number columns 0-15. But when I use this command, I get somewhat of an unordered list, see below.

Code: cat /proc/interrupts
CPU0 CPU1
0: 48 7 IO-APIC-edge timer
1: 247 205 IO-APIC-edge i8042

[Code]....

View 1 Replies View Related

General :: Sort Columns Of Data (descending To Ascending)?

Mar 21, 2011

I have an ASCII file containing 3 Columns of descending data as flollows:

3277.233 | 9.032167E-16 | 5.354040E-16
3276.725 | 1.825813E-15 | 7.552098E-16
3276.211| 2.472245E-15 | 8.826818E-16
3275.699| 2.943001E-16 | 3.192112E-16

[Code]....

I want to sort them in ascending order.

Does anybody know how to do it in Ubuntu 10.4.

View 5 Replies View Related

General :: Running DF Command - Huge Space Between Columns

Jul 13, 2011

I am running the command on a Mac but due to it being a generic unix command and a command line query.. I thought I can write on this forum.. I am running the command

Code:
df -h | grep '/dev/'
I get
Code:
/dev/disk0s2 389Gi 62Gi 327Gi 16% /
/dev/disk0s3 76Gi 24Gi 52Gi 32% /Volumes/Backup
/dev/disk3s2 500Gi 47Gi 453Gi 10% /Volumes/Misc
Note the huge space between the 1st and 2nd Column..

This is because currently I have some NAS drives mounted which are not showing due to grep. When they are not mounted. The output is fine with equal spaces between each column (like between col 2 and 3.. or 3 and 4). I want to do a (dare I say) sed or awk or something to reduce the space between 1st and 2nd col. So that it has space like between col 3 and 4.. or 2 and 3. This is because I am showing this output somewhere and because of the space its not showing up correctly.Also I hope the command will still work when the NAS drives (afp) are not mounted.. basically consistency. The spaces are not showing properly in the quote tag. Changed it to CODE tag.

View 12 Replies View Related

General :: Parsing Columns In Bash / Extract The First Set Of Numbers And Get Them To Appear Only Once?

Sep 28, 2009

as a result of a find command, i have

852065 72: /bin/gunzip
852065 72: /bin/gzip
852065 72: /bin/zcat

(the first column is inode number and the second is size if you're curious)

I want to be able to format it in a way such that:
852065 72:
/bin/gunzip
/bin/gzip
/bin/zcat

I know I can get the bottom half using awk- but I can't figure out how to extract the first set of numbers and get them to appear only once

View 9 Replies View Related

General :: Reduce Bash Script Length?

Jul 30, 2010

At last i finish my script to find the status of the URL , in this code i used all the status codes, because of this it take too much of length. with the help of wiki only i find all the status codes.code...

View 7 Replies View Related

General :: Determine Mp3 Length By File Size?

Nov 16, 2010

Multiple dirs full of mp3s All strictly encoded with exactly the same parameters (CBR 128kbps, Joint-Stereo, etc) Is it possible to determine the total playing time (to within ~98% accuracy) by some formula based on the total file size? I say ~98% accurate since ID3 tags do consume a small amount of space.

View 3 Replies View Related

General :: Variable Length Console Prompt?

Jul 15, 2010

I have a question about the prompt. it is very easy to tune it for it to be colored and display path where you are etc. But my problem is that when the path is too long I would prefer the code line to be on the folowing line...

Ex
11:00 me@host a/short/path > ls -ltr ./stuff
11:00 me@host a/very/very/very/long/path
> ls -ltr ./stuff

and to be honnest as I am very new in LINUX I don't know how to do this...

View 7 Replies View Related

General :: Delete Lines From File By Their's Length

Apr 27, 2010

i've got a file with sorted words - one on each line.How could it be possible to delete thouse lines that have words of length 1 or 2 (1-2 letters). I guess a good way it will be with AWK, n its fuction length(), but getting it, i dont know how to delete those very lines.

View 14 Replies View Related

General :: How To Reduce Bash Script Length

Mar 19, 2011

At last i finish my script to find the status of the URL , in this code i used all the status codes, because of this it take too much of length. with the help of wiki only i find all the status codes.Quote:and my question is do we need all the status codes necessary in this script..and is there any other way to reduce the code using any conditonal statements..code...

View 6 Replies View Related

General :: Determine Number Of Rows And Columns Of File In Shell?

Mar 4, 2010

if there's a tab-delimited file under /usr/desktop, how can I determine the number of rows and columns of the file in shell?And, if told the the 3rd column of the file contains only numerical values and all values in the 5th column are unique, how can I verify these in shell?

View 13 Replies View Related

General :: Set The Length Time Before Session Times Out Due To Inactivity?

Feb 20, 2011

I've just installed Ubuntu 10.04 and find that if I leave the machine for more than a couple minutes, it will automatically log me out. Instructions at other sites have indicated that session controls are to be found in System>Properties. But there is no Session in the list under Properties in Ubuntu 10.04. How can I control this feature so that I'm not having to constantly login every time I turn around? I've searched everywhere and can't find a solution.

View 3 Replies View Related

General :: Regex To Find Min / Max Length Words In File?

Jan 29, 2011

i am trying to find all 3 and 4-character length words in my file (which is huge and has alot of entries in it, a big fat wordlist!).My attempt with this regular expression (which I thought should work, found something on length search here: [URL]

cat sorted_noapostrophe.txt| grep '.{3,4}'

but it returns no results? Also to find any words starting with 'f' which are between 3 and 5 characters (inclusive) long, how can this be done?

View 4 Replies View Related

General :: Compare 2 Files In Unix?

Aug 9, 2011

file 1 :

DB_NAME FIRST_ACTIVE_LOG DBPARTITIONNUM
-------- -------------------- --------------
BP1 279231 0
BP1 12735 1
BP1 12734 2
BP1 12735 3
BP1 12616 4

[Code]...

View 4 Replies View Related

General :: Any Possibility To Compare Two Partitions?

Jan 22, 2010

I have two partitions and I would like to compare them to see it they are the same. Is that possible?

View 1 Replies View Related

General :: Compare Two Directories In Different Servers?

Mar 28, 2011

I have a requirement. I need to write a shell script which will compare two directories residing in two different servers (SERVER A and SERVER B) and list out the discrepancies if found any. Script will be running from SERVER A.

View 3 Replies View Related

General :: Compare Distributions By Ram Usage?

Jan 20, 2011

compare the best ram memory usage among linux distributions?

At the moment with some live linux distributions I run "free -m", on the terminal of the graphical dektop environment, without running any other command or application. Is "free -m" the rightest way to evaluate the amount of all the available ram memory left by a linux distribution? Which are the values to sum to evaluate all the available ram memory for the operating system?

Code:
free -m
total used free shared buffers cached
Mem: 499 451 47 0 23 229
-/+ buffers/cache: 198 300
Swap: 1027 0 1027

View 6 Replies View Related

General :: Points To Compare Distros?

Apr 1, 2010

I 've a question regarding which points should be considered to compare 2 different linux distros say RedHat & Ubuntu. for a production environment non-db applications ..

View 3 Replies View Related

General :: Any Benchmark Could Use To Compare Kickstart With WDS?

Jun 21, 2010

Does anyone know of any benchmark I could use to compare kickstart with WDS?Apart from like saying that windows takes 15mins to deply a system comapared to Kickstart.What else can i really use and put figures to it?

View 1 Replies View Related

General :: Compare DrawSWF And Macromedia

Oct 19, 2009

Is DrawSWF (flash for linux) as powerful as Macromedia Flash (Windows)? Coz i used macromedia for some time & found it so, so, so powerful as in libraries and functions?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved