Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Get information from one files, based on data from other file Post 303019587 by RudiC on Monday 2nd of July 2018 03:17:32 PM
Old 07-02-2018
Single grep approach:
Code:
sed 's/^/^/' filea | grep  -of- fileb | sort | uniq -c
      1 39
      2 44

You can drop the sort if fileb is already sorted.
These 2 Users Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script to delete folder based on text file information

I have been working on a script to list all the name's of a subfolder in a text file then edit that text file and then delete the subfolder base on the edited text file so far I have been able to do every thing I just talked about but can't figure out how to delete the subfolers base on a text file... (8 Replies)
Discussion started by: bone11409
8 Replies

2. Shell Programming and Scripting

How to extract information from two files with data range

Hi, I want to make a query about extracting data from two files that both have data ranges. the data that i want to extract; when there is matching between file1 column 2 is equal to file2 column2 , and file1 column 3 and column 4 is within the range of file2 columns 3 and 4. I would like rows... (1 Reply)
Discussion started by: houkto
1 Replies

3. Shell Programming and Scripting

Help me pls : splitting single file in unix into different files based on data

I have a file in unix with sample data as follows : -------------------------------------------------------------- -------------------------------------------------------------- {30001002|XXparameter|Layout|$ I want this file to be splitted into different files and corresponding to the sample... (54 Replies)
Discussion started by: Ravindra Swan
54 Replies

4. Shell Programming and Scripting

Generate tabular data based on a column value from an existing data file

Hi, I have a data file with : 01/28/2012,1,1,98995 01/28/2012,1,2,7195 01/29/2012,1,1,98995 01/29/2012,1,2,7195 01/30/2012,1,1,98896 01/30/2012,1,2,7083 01/31/2012,1,1,98896 01/31/2012,1,2,7083 02/01/2012,1,1,98896 02/01/2012,1,2,7083 02/02/2012,1,1,98899 02/02/2012,1,2,7083 I... (1 Reply)
Discussion started by: himanish
1 Replies

5. Shell Programming and Scripting

Appending information from 2nd file into 1st based on intervals

Hi, I am trying to gather information from the second file and append it to the first file. input HWUSI-EAS000_29:1:100:10000:11479#0/1 + chr5 14458050 ATTGGCTGAGGTCCTACTAGTTGTGATGTGTAAGTGT HHHHHHGDGGEDGGGDGCGEDDEFFFAGE 0 second file:... (14 Replies)
Discussion started by: Diya123
14 Replies

6. UNIX for Dummies Questions & Answers

Obtaining File information based on String Search

Is there a single Command in Unix to get the following Information when searching for files containing one or more strings in a Unix Directory (including sub directories within it) : 1) Complete filename ( path and filename) 2) Owner of the file 3) Size of the file 4) Last Modified date... (3 Replies)
Discussion started by: pchegoor
3 Replies

7. Shell Programming and Scripting

Pulling information from a data file by date

awk -v now="$(date +%s)" -v tDiff="${USERMINUTES}" ' BEGIN { FS="=" if (!now) now=systime() if (!tDiff) tDiff=60*60 p=1 } /{/ {rec=$0;p=1;next} /}/ && rec && p {print rec ORS $0;next} $1=="entry_time" { if (now-$2>tDiff)p=0 } {rec=rec ORS $0}'... (6 Replies)
Discussion started by: SkySmart
6 Replies

8. UNIX for Beginners Questions & Answers

Create file based on data from two other files

I have looked through several threads regarding merging files with awk and attempted using join however have been unsuccessful likely as I do not fully understand awk. What I am attempting is to take a csv file which could be between 1 and 15,000 lines with 5 colums and another csv file that will... (4 Replies)
Discussion started by: cdubu2
4 Replies

9. Shell Programming and Scripting

How to create file and file content based existing information?

Hi Gurus, I am SQL developer and new unix user. I need to create some file and file content based on information in two files. I have one file contains basic information below file1 and another exception file file2. the rule is if "zone' and "cd" in file1 exists in file2, then file name is... (13 Replies)
Discussion started by: Torhong
13 Replies

10. Shell Programming and Scripting

In PErl script: need to read the data one file and generate multiple files based on the data

We have the data looks like below in a log file. I want to generat files based on the string between two hash(#) symbol like below Source: #ext1#test1.tale2 drop #ext1#test11.tale21 drop #ext1#test123.tale21 drop #ext2#test1.tale21 drop #ext2#test12.tale21 drop #ext3#test11.tale21 drop... (5 Replies)
Discussion started by: Sanjeev G
5 Replies
AUTODIA(1p)						User Contributed Perl Documentation					       AUTODIA(1p)

NAME
autodia - a perl script using the Autodia modules to create UML Class Diagrams or documents. from code or other data sources. INTRODUCTION
AutoDia takes source files as input and using a handler parses them to create documentation through templates. The handlers allow AutoDia to parse any language by providing a handler and registering in in autodia.pm. The templates allow the output to be heavily customised from Dia XML to simple HTML and seperates the logic of the application from the presentation of the results. AutoDia is written in perl and defaults to the perl handler and file extension matching unless a language is specified using the -l switch. AutoDia requires Template Toolkit and Perl 5. Some handlers and templates may require additional software, for example the Java SDK for the java handler. AutoDia can use GraphViz to generate layout coordinates, and can produce di-graphs (notation for directional graphs) in dot (plain or canonical) and vcg, as well as Dia xml. Helpful information, links and news can be found at the autodia website - http://www.aarontrevena.co.uk/opensource/autodia/ USAGE
"autodia ([-i filename [-p path] ] or [-d directory [-r] ]) [options]" "autodia -i filename : use filename as input" "autodia -i 'filea fileb filec' : use filea, fileb and filec as input" "autodia -i filename -p .. : use ../filename as input file" "autodia -d directoryname : use *.pl/pm in directoryname as input files" "autodia -d 'foo bar quz' : use *pl/pm in directories foo, bar and quz as input files" "autodia -d directory -r : use *pl/pm in directory and its subdirectories as input files" "autodia -d directory -F : use files in directory but only one file per diagram" =item "autodia.pl -d directory -C : use files in directory but skip CVS directories" "autodia -o outfile.xml : use outfile.xml as output file (otherwise uses autodial.out.dia)" "autodia -O : output to stdout" "autodia -l language : parse source as language (ie: C) and look for appropriate filename extensions if also -d" "autodia -t templatefile : use templatefile as template (otherwise uses template.xml)" "autodia -l DBI -i "mysql:test:localhost" -U username -P password : use test database on localhost with username and password as username and password" "autodia -l Mason -i "/index.html" -p comp_root -G '$c' : use HTML::Mason to fetch /index.html from comp_root and show all components in reach. -G corresponds to allow_globals." "autodia -z : output via graphviz" "autodia -Z : output via springgraph" "autodia -v : output via VCG " "autodia -s skipfile : exclude files or packagenames matching those listed in file" c<autodia -D : ignore dependancies (ie do not process or display dependancies)> "autodia -K : do not display packages that are not part of input" "autodia -k : do not display superclasses that are not part of input" "autodia -H : show only Public/Visible methods" "autodia -m : show only Class methods" "autodia -M : do not show Class Methods" "autodia -a : show only Class Attributes" "autodia -A : do not show Class Attributes" "autodia -S : silent mode, no output to stdout except with -O" "autodia -h : display this help message" "autodia -V : display version and copyright message" perl v5.12.4 2011-05-23 AUTODIA(1p)
All times are GMT -4. The time now is 11:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy