Sponsored Content
Top Forums Shell Programming and Scripting Request to check: find common and write before it Post 302673689 by itkamaraj on Wednesday 18th of July 2012 08:55:56 AM
Old 07-18-2012
Code:
$ awk '{if(a[$2]){a[$2]=a[$2]","$1}else{a[$2]=$1}}END{for (i in a)print i,a[i]}' input.txt
dfg RA,HT
wer CAD,HT,CD,T1D,T2D,BD
hfd CAD
jgh CD
ejkhfr RA

i dont know what is the use of 2nd file ?

if you want only the 2nd file patterns, then use fgrep to the output of awk command
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Request to check:find out common entries

I have to compare 2 files which means 2 files with common entries in same column and separate those common entries in a diferent file as well right before those entries common so that I can separat common and Uncommon entries in rows in 2 different files. Is it possible For eg. one file ... (3 Replies)
Discussion started by: manigrover
3 Replies

2. Shell Programming and Scripting

Request to check:remove entries more than once

Hi I have a file like this 1234 2345 567889 567889 2345 234899420 83743 2345 67890 67890 ................ so on I want to delete entries which are more than once like 2345, 567889 and 67890 so that these appear once (4 Replies)
Discussion started by: manigrover
4 Replies

3. Web Development

Request to check:PHP help hw to proceed

Hi I am new to PHP. I have to changed a website design adn add certain features and lnks which shuld direct it towards other website. Can any body help me how to proceed. I have some already made templates to do this. I am conpletely new.. So, I have to first install Php from... (0 Replies)
Discussion started by: manigrover
0 Replies

4. Shell Programming and Scripting

Request to check: Not printing all entries

Dear all, I am facing one problem in my input file there are many Entries which starts from *FIELD * AV (checked the attached file) I want all the entries in the output file which start from *FIELD * AV I have written this programm but its not printing all the entries with *FIELD... (4 Replies)
Discussion started by: manigrover
4 Replies

5. Shell Programming and Scripting

Request to check:Remove duplicates

Hi all I have a file with following kind of data I want to remove duplicates according to first column so that output contains Kindly let me scripting regading this. (4 Replies)
Discussion started by: manigrover
4 Replies

6. Shell Programming and Scripting

Request to check remove duplicates but write before it

Hi alll I have a file with following kind input I want in output duplicates should not be there but there should be numbering mentioned before that like (4 Replies)
Discussion started by: manigrover
4 Replies

7. Shell Programming and Scripting

Request to check: compare two files , match same entries, write data before it

Hi all, I have 2 files:Column1 of first file has to be matched with column 3 of second file first file contain DATA like this in 2 columns one with gene name second with whether CAD,HT,RA T2Dor any one column 1 column2 ARFGEF2 CAD DDEF2 CAD PSCD3 CAD PSCD4 CAD CAMK1... (5 Replies)
Discussion started by: manigrover
5 Replies

8. Shell Programming and Scripting

Request to check:remove duplicates and write sytematically

Hi all I have a file with following input It contains 5 columns gene name drug drug ID disease approved Now the same gene is repeated many times with different data in column2,3 ,4,5 I want to arrange dat in such a way that there shuld be one entry in the column(no... (2 Replies)
Discussion started by: manigrover
2 Replies

9. Shell Programming and Scripting

Find common entries in 2 list and write data before it

Hi all, I have 2 files: second file I want if entries in one file will match in other file. It shuld wite approve before it so output shuld be (1 Reply)
Discussion started by: manigrover
1 Replies

10. Shell Programming and Scripting

Request to check:Fetch certain entries

Hi all. Kindly check it it's urgent!! I have one big file from which which I have to fetch certain data I have attached a small part of this file. from the attached file, I have to fetch and arrange data in 3 columns 1 Generic name 2. Brand names 3. Drug... (10 Replies)
Discussion started by: manigrover
10 Replies
FSCK_HFS(8)						    BSD System Manager's Manual 					       FSCK_HFS(8)

NAME
fsck_hfs -- HFS file system consistency check SYNOPSIS
fsck_hfs -q [-df] special ... fsck_hfs -p [-df] special ... fsck_hfs [-n | -y | -r] [-dfg] [-m mode] special ... DESCRIPTION
The fsck_hfs utility verifies and repairs standard HFS and HFS+ file systems. The first form of fsck_hfs quickly checks the specified file systems to determine whether they were cleanly unmounted. The second form of fsck_hfs preens the specified file systems. It is normally started by fsck(8) run from /etc/rc.boot during automatic reboot, when a HFS file system is detected. When preening file systems, fsck_hfs will fix common inconsistencies for file systems that were not unmounted cleanly. If more serious problems are found, fsck_hfs does not try to fix them, indicates that it was not successful, and exits. The third form of fsck_hfs checks the specified file systems and tries to repair all detected inconsistencies. If no options are specified fsck_hfs will always check and attempt to fix the specified file systems. The options are as follows: -d Display debugging information. This option may provide useful information when fsck_hfs cannot repair a damaged file system. -f When used with the -p option, force fsck_hfs to check `clean' file systems, otherwise it means force fsck_hfs to check and repair journaled HFS+ file systems. -g Causes fsck_hfs to generate it's output strings in GUI format. This option is used when another application with a graphical user interface (like Mac OS X Disk Utility) is envoking the fsck_hfs tool. -m mode Mode is an octal number that will be used to set the permissions for the lost+found directory when it is created. The lost+found directory is only created when a volume is repaired and orphaned files or directories are detected. fsck_hfs places orphaned files and directories into the lost+found directory (located at the root of the volume). The default mode is 01777. -p Preen the specified file systems. -q Causes fsck_hfs to quickly check whether the volume was unmounted cleanly. If the volume was unmounted cleanly, then the exit status is 0. If the volume was not unmounted cleanly, then the exit status will be non-zero. In either case, a message is printed to standard output describing whether the volume was clean or dirty. -y Always attempt to repair any damage that is found. -n Never attempt to repair any damage that is found. -r Rebuild the catalog file on the specified file system. This option currently will only work if there is enough contiguous space on the specified file system for a new catalog file and if there is no damage to the leaf nodes in the existing catalog file. Because of inconsistencies between the block device and the buffer cache, the raw device should always be used. SEE ALSO
fsck(8) BUGS
fsck_hfs is not able to fix some inconsistencies that it detects. HISTORY
The fsck_hfs command appeared in Mac OS X Server 1.0 . Mac OS X November 21, 2002 Mac OS X
All times are GMT -4. The time now is 08:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy