Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Delete data blocks based on missing combinations Post 302923976 by senhia83 on Wednesday 5th of November 2014 02:18:50 PM
Old 11-05-2014
Quote:
Originally Posted by RudiC
Any attempt from your side?
yes, I have tried, but its coming up with syntax errors

Code:
awk -F'\t' 'NR==FNR{a[$1"\t"$2]=$0;next} $[$2"\t"$3] in a {b[$2"\t"$3]=$0; if ($0=="") else print b[$0]}1' OFS='\t' file1 file2

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Delete blocks with no data..

Hi, I tried this but could not get it... here is what I need I have an xml where I get all the data in blocks but some times I get empty blocks with no data...shown below..I need to delete only those blocks with no data, I tried couple of ways but could not do it..any help is appreciated...... (1 Reply)
Discussion started by: mgirinath
1 Replies

2. Shell Programming and Scripting

Sorting blocks of data

Hello all, Below is what I am trying to accomplish: I have a file that looks like this /* ----------------- xxxx.y_abcd_00000050 ----------------- */ jdghjghkla sadgsdags asdgsdgasd asdgsagasdg /* ----------------- xxxx.y_abcd_00000055 ----------------- */ sdgsdg sdgxcvzxcbv... (8 Replies)
Discussion started by: alfredo123
8 Replies

3. Shell Programming and Scripting

Delete blocks of lines from text file

Hello, Hello Firends, I have file like below. I want to remove selected blocks say abc,pqr,lst. how can i remove those blocks from file. zone abc { blah blah blah } zone xyz { blah blah blah } zone pqr { blah blah blah } (4 Replies)
Discussion started by: nrbhole
4 Replies

4. Shell Programming and Scripting

Delete Blank Lines Between DHCP Host Blocks

Hi All, I have a dhcpd.conf file that gets static hosts added and removed via a shell script. After sometime, there becomes huge gaps of space ( blank lines ) between each host block. I tried a couple of sed one-liners; but, I can't seem to get the output I'm looking for. Also, I would like... (4 Replies)
Discussion started by: cstovall
4 Replies

5. UNIX for Dummies Questions & Answers

Using SED to delete between two blocks.....and then repeating.

Hi All I'm still on my slow and painful self teach learning experience with SED. My latest issue is getting my head around how best to do the following. I have a file that's created using iwlist that I want to chop up into paragraphs then only keep the ones I see as potential threats. I... (3 Replies)
Discussion started by: Bashingaway
3 Replies

6. Shell Programming and Scripting

Extracting data blocks from file

Hi all, I want to extract blocks of data from a file depending on the contents of that block. The input file(table) has several blocks each starting with 'gene' in the first column. I want to extract only those blocks which do not have the expression '_T02' in the second column. Input file ... (3 Replies)
Discussion started by: newbie83
3 Replies

7. 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

8. Shell Programming and Scripting

Modify blocks of text by printing missing columns

Hi Experts, I have a problem where I want to print missing columns (3,4) within a block of text. Each block is separated by "###". Some rows have missing column 3 and 4 which should be same as the previous value in column 3 and 4. The file is space delimited. For example: INPUT ###... (5 Replies)
Discussion started by: mira
5 Replies

9. Shell Programming and Scripting

Create combinations based on scores

Hi experts, I have a score matrix like below, where the 3rd column ( 1 max, 0 min) says how close the 2nd column variable is to the 1st column variable a b 0.3 a c 0.87 a d 0.75 b x 0.67 b y 0.98 b z 0.24 c ... (4 Replies)
Discussion started by: jianp83
4 Replies

10. Programming

Mismatched free() / delete / delete [] line no missing

Could you tell me the possibilities of the reason to get the Mismatched free() / delete / delete . I unable to see the line no in the valgrind report. it displays the function name. with that function name, I am not able to find where exactly the issue is there.I am getting the Mismatched free()... (3 Replies)
Discussion started by: SA_Palani
3 Replies
gfs2_tool(8)						      System Manager's Manual						      gfs2_tool(8)

NAME
gfs2_tool - interface to gfs2 ioctl/sysfs calls SYNOPSIS
gfs2_tool COMMAND [OPTION]... DESCRIPTION
gfs2_tool is an interface to a variety of the GFS2 ioctl/sysfs calls. Some of the functions of gfs_tool have been replaced by standard sys- tem tools such as mount and chattr, so gfs2_tool doesn't have as many options as gfs_tool used to. COMMANDS
clearflag Flag File1 File2 ... Clear an attribute flag on a file. This is now obsolete and kept only for backward compatibility, chattr is the preferred way to clear attribute flags. See setflag for available flags. This option will probably be removed at a future date. freeze MountPoint Freeze (quiesce) a GFS2 cluster. gettune MountPoint Print out the current values of the tuning parameters in a running filesystem. A better source of similar (more comprehensive) information is that in the /proc/mounts file. Running the mount command with no arguments will also provide the same information. This option is considered obsolete and will probably be removed at some future date. journals MountPoint Print out information about the journals in a mounted filesystem. lockdump MountPoint Print out information about the locks this machine holds for a given filesystem. This information is also available via the debugfs glock dump file, and accessing that file is the preferred method of obtaining a dump of the glock state. sb device proto [newvalue] View (and possibly replace) the name of the locking protocol in the file system superblock. The file system shouldn't be mounted by any client when you do this. sb device table [newvalue] View (and possibly replace) the name of the locking table in the file system superblock. The file system shouldn't be mounted by any client when you do this. sb device ondisk [newvalue] View (and possibly replace) the ondisk format number in the file system superblock. The file system shouldn't be mounted by any client when you do this. No one should have to use this. sb device multihost [newvalue] View (and possibly replace) the multihost format number in the file system superblock. The file system shouldn't be mounted by any client when you do this. No one should have to use this. sb device uuid [newvalue] View (and possibly replace) the uuid in the file system superblock. The file system shouldn't be mounted by any client when you do this. The new uuid value should be in the standard uuid format. For example: 1AEA8269-15C5-72BD-6D83-8720B17AA4EE sb device all Print out the superblock. setflag Flag File1 File2 ... Set an attribute flag on a file. The currently supported flags are jdata, immutable, appendonly, noatime, and sync. The chattr command is the preferred way to set attributes on files. This option will probably be removed at a future date. The jdata flag causes all the data written to a file to be journaled. If the jdata flag is set for a directory, all files and directories subsequently created within that directory are also journaled. This behavior replaces the old inherit_jdata flag from gfs. Same as chattr +j. The immutable flag marks the file immutable. The behavior is similar to the immutable flag in the ext2/3 filesystems. All write access is denied. Same as chattr +i. The appendonly flag causes all data to be written at the end of the file. Same as chattr +a. The noatime flag disables updates to the file's access time. Same as chattr +A. The sync flag causes data written to the file to be sync'ed to stable storage immediately. Same as chattr +S. settune MountPoint parameter newvalue Set the value of tuning parameter. Use gettune for a listing of tunable parameters. The mount -oremount command is the preferred way to set the values of tunable parameters. At some future stage, when all parameters can be set via mount, this option will be removed. unfreeze MountPoint Unfreeze a GFS2 cluster. version Print out the version of GFS2 that this program goes with. withdraw MountPoint Cause GFS2 to abnormally shutdown a given filesystem on this node. This feature is only useful for testing and should not be used during normal filesystem operation. gfs2_tool(8)
All times are GMT -4. The time now is 07:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy