Sponsored Content
Top Forums Shell Programming and Scripting Reading 2 CSV files and filtering data based on group Post 302710243 by elixir_sinari on Thursday 4th of October 2012 06:12:41 AM
Old 10-04-2012
Quote:
Originally Posted by rakesh_arxmind
Code:
awk -F, 'FNR==NR{a[$2]=$3;next}
 {print a[$4]}' OFS=, file2.csv file1.csv

Thanks for your answer. I was trying this but even this is not working and it prints 6 empty rows. Can you please help?
I did not provide this solution!!!
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to listout the files based on group by the date...?

Hi, How to listout the files based on group by of date...? suppose if have list of 10 files which was created by on today(Apr 18) and yesterday(Apr 17 ) in my personal directory like this if i issue ls -rtl | grep "Apr 18" list out the file which was created/updated only on Apr 18th. ... (3 Replies)
Discussion started by: psiva_arul
3 Replies

2. Shell Programming and Scripting

Help with pulling / filtering data from a .csv

Good day Gurus, I have a csv file that contains an inventory of active servers. This csv file contains a well over a hundred systems (IBM, SUN, HP). It also contains those systems details. See below for an example hostA,invver,1.02,20100430 hostA,date,08/30/2010,06:18 hostA,use,"Unknown... (4 Replies)
Discussion started by: LuffyDMonkey
4 Replies

3. Shell Programming and Scripting

Reading the data from CSV and performing search through shell script

Hello, I am working on building a script that does the below actions together in my Linux server. 1) First, have to read the list of strings mentioned in CSV and store it in the shell script 2) Second, pick one by one from the string list, and search a particular folder for files that... (2 Replies)
Discussion started by: vikrams
2 Replies

4. Shell Programming and Scripting

extract data in a csv file based on a certain field.

I have a csv file that I need to extract some data from depending on another field after reading info from another text file. The text file would say have 592560 in it. The csv file may have some data like so Field 1 Field2 Field3 Field4 Field5 Field6 20009756 1 ... (9 Replies)
Discussion started by: GroveTuckey
9 Replies

5. Shell Programming and Scripting

Matching and Merging csv data fields based on a common field

Dear List, I have a file of csv data which has a different line per compliance check per host. I do not want any omissions from this csv data file which looks like this: date,hostname,status,color,check 02-03-2012,COMP1,FAIL,Yellow,auth_pass_change... (3 Replies)
Discussion started by: landossa
3 Replies

6. UNIX for Dummies Questions & Answers

using sed delete a line from csv file based on specific data in two separate fields

Hello, :wall: I have a 12 column csv file. I wish to delete the entire line if column 7 = hello and column 12 = goodbye. I have tried everything that I can find in all of my ref books. I know this does not work /^*,*,*,*,*,*,"hello",*,*,*,*,"goodbye"/d Any ideas? Thanks Please... (2 Replies)
Discussion started by: Chris Eagleson
2 Replies

7. UNIX for Dummies Questions & Answers

Shell script to extract data from csv file based on certain conditions

Hi Guys, I am new to shell script.I need your help to write a shell script. I need to write a shell script to extract data from a .csv file where columns are ',' separated. The file has 5 columns having values say column 1,column 2.....column 5 as below along with their valuesm.... (1 Reply)
Discussion started by: Vivekit82
1 Replies

8. Shell Programming and Scripting

Script for extracting data from csv file based on column values.

Hi all, I am new to shell script.I need your help to write a shell script. I need to write a shell script to extract data from a .csv file where columns are ',' separated. The file has 5 columns having values say column 1,column 2.....column 5 as below along with their valuesm.... (3 Replies)
Discussion started by: Vivekit82
3 Replies

9. Shell Programming and Scripting

Filtering data from text to csv

Hello, Is there a way to filerter data from a text file as shown below to a Column e.g. hostname nfsmount as two separate column. Currently I could get hostname and the mount is appearing below.. using this script #! /bin/bash for i in `cat fqdn.txt` do echo "$i ............ " >>... (3 Replies)
Discussion started by: Cy Pqa
3 Replies

10. UNIX for Beginners Questions & Answers

Filtering records of a csv file based on a value of a column

Hi, I tried filtering the records in a csv file using "awk" command listed below. awk -F"~" '$4 ~ /Active/{print }' inputfile > outputfile The output always has all the entries. The same command worked for different users from one of the forum links. content of file I was... (3 Replies)
Discussion started by: sunilmudikonda
3 Replies
bon_csv2html(1) 					      General Commands Manual						   bon_csv2html(1)

NAME
bon_csv2html program to convert CSV format Bonnie++ data to a HTML form using tables suitable for display on a web page. NB Lynx can't dis- play this properly, and due to the size it probably requires 1024x768 monitor to display properly. bon_csv2txt program to convert CSV format Bonnie++ data to plain-text format suitable for pasting into an email or reading on a Braille display. DESCRIPTION
They take CSV format (comma-delimited spreadsheet files AKA Comma Seperated Values in MS land) data on standard input and produce HTML or plain text on standard output respectively. FORMAT
This is a list of the fields used in the CSV files format version 2. Format version 1 was the type used in Bonnie++ < 1.90. Before each field I list the field number as well as the name given in the heading 0 format_version Version of the output format in use (1.96) 1 bonnie_version (1.96) 2 name Machine Name 3 concurrency The number of copies of each operation to be run at the same time 4 seed Random number seed 5 file_size Size in megs for the IO tests 6 chunk_size Size of chunks in bytes 7 putc,putc_cpu Results for writing a character at a time K/s,%CPU 9 put_block,put_block_cpu Results for writing a block at a time K/s,%CPU 11 rewrite,rewrite_cpu Results for reading and re-writing a block at a time K/s,%CPU 13 getc,getc_cpu Results for reading a character at a time K/s,%CPU 15 get_block,get_block_cpu Results for reading a block at a time K/s,%CPU 17 seeks,seeks_cpu Results for the seek test seeks/s,%CPU 19 num_files Number of files for file-creation tests (units of 1024 files) 20 max_size The maximum size of files for file-creation tests. Or the type of files for links. 21 min_size The minimum size of files for file-creation tests. 22 num_dirs The number of directories for creation of files in multiple directories. 23 file_chunk_size The size of blocks for writing multiple files. 24 seq_create,seq_create_cpu Rate of creating files sequentially files/s,%CPU 26 seq_stat,seq_stat_cpu Rate of reading/stating files sequentially files/s,%CPU 28 seq_del,seq_del_cpu Rate of deleting files sequentially files/s,%CPU 30 ran_create,ran_create_cpu Rate of creating files in random order files/s,%CPU 32 ran_stat,ran_stat_cpu Rate of deleting files in random order files/s,%CPU 34 ran_del,ran_del_cpu Rate of deleting files in random order files/s,%CPU 36 putc_latency,put_block_latency,rewrite_latency Latency (maximum amount of time for a single operation) for putc, put_block, and reqrite 39 getc_latency,get_block_latency,seeks_latency Latency for getc, get_block, and seeks 42 seq_create_latency,seq_stat_latency,seq_del_latency Latency for seq_create, seq_stat, and seq_del 45 ran_create_latency,ran_stat_latency,ran_del_latency Latency for ran_create, ran_stat, and ran_del A string that starts with '#' is a comment. AUTHOR
These programs were written by Russell Coker <russell@coker.com.au>. May be freely used and distributed without restriction. bon_csv2html(1)
All times are GMT -4. The time now is 01:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy