Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Search and delete a row which is delimited by |^ Post 303043378 by RavinderSingh13 on Monday 27th of January 2020 04:09:11 AM
Old 01-27-2020
Hello Tuxidow,

Could you please try following.

Code:
awk -F'\\|\\^' '$3==""{next} $4'  Input_file

NOTE: After seeing Rudi sir's comment edited this solution now.

Thanks,
R. Singh

Last edited by RavinderSingh13; 01-27-2020 at 05:32 AM..
This User Gave Thanks to RavinderSingh13 For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Delete last value from pipe delimited file

I have a large(ish) pipe delimited file. The last line of the file contains a total row count and a checksum: END|1537451|1328569446 After making other adjustments to the file, I need to strip out the checksum and apply a new value - I have a script to generate the checksum and 'cat' it... (3 Replies)
Discussion started by: relentl3ss
3 Replies

2. UNIX for Dummies Questions & Answers

How do you delete cells from a space delimited text file given row and column number?

How do you delete cells from a space delimited text file given row and column number? Letś say the row number is r and the column number is c. Thanks! (5 Replies)
Discussion started by: evelibertine
5 Replies

3. UNIX for Dummies Questions & Answers

Delete header row and reformat from tab delimited to fixed width

Hello gurus, I have a file in a tab delimited format and a header row. I need a code to delete the header in the file, and convert the file to a fixed width format, with all the columns aligned. Below is a sample of the file:... (4 Replies)
Discussion started by: chumsky
4 Replies

4. Shell Programming and Scripting

search column and delete row if greater than value

Hi, as the title states i need to find a way to search a column for values great than 1000, and if it is, then delete that row. An example 1 7.021 6.967 116.019 4 U 6.980E+07 0.000E+00 e 0 0 0 0 2 8.292 7.908 118.063 3 U 1.440E+07 0.000E+00 e 0 821 814 ... (3 Replies)
Discussion started by: olifu02
3 Replies

5. Shell Programming and Scripting

Comma delimited row into multiple rows, repeat first value

i am building a database to keep track of unix groups. Using the command "ypcat group" I get an output similar to the following group1:GROUP:9999:user1,user2,user3 groupA:GROUP:1111:usera,userb,userc I want to convert this output so it looks like this group1:user1 group1:user2... (2 Replies)
Discussion started by: newreverie
2 Replies

6. Shell Programming and Scripting

Converting a list to a row delimited

Hello, I have a large database with the following structure: set of clustered names followed by a hard return and followed by a second set of clustered names and so on. Sometimes the clusters can be as many as 150. Since the data is in an Indian language, a theoretical example will make this... (9 Replies)
Discussion started by: gimley
9 Replies

7. Shell Programming and Scripting

Parse tab delimited file, check condition and delete row

I am fairly new to programming and trying to resolve this problem. I have the file like this. CHROM POS REF ALT 10_sample.bam 11_sample.bam 12_sample.bam 13_sample.bam 14_sample.bam 15_sample.bam 16_sample.bam tg93 77 T C T T T T T tg93 79 ... (4 Replies)
Discussion started by: empyrean
4 Replies

8. Shell Programming and Scripting

awk read one delimited file, search another delimited file

Hello folks, I have another doozy. I have two files. The first file has four fields in it. These four fields map to different locations in my second file. What I want to do is read the master file (file 2 - 23 fields) and compare each line against each record in file 1. If I get a match in all four... (4 Replies)
Discussion started by: dagamier
4 Replies

9. Shell Programming and Scripting

Search row by row from one file to another file if match is found print few colums of file 2

this is the requirement list.txt table1 table2 table3 testfile.txt name#place#data#select * from table1 name2#place2#data2#select * from table 10 innerjoin table3 name2#place2#data2#select * from table 10 output name place table1 name2 place table3 i tried using awk (7 Replies)
Discussion started by: vamsekumar
7 Replies

10. UNIX for Beginners Questions & Answers

awk to parse current and next row in tab-delimited file

Hi there, I would like to use awk to reformat a tab-delimited file containing three columns as follows: Data file: sample 1 173 sample 269 530 sample 687 733 sample 1699 1779 Desired output file: sample 174..265, 531..686, 734..1698 I need the value... (5 Replies)
Discussion started by: emiley
5 Replies
NOTE(3EXT)						    Extended Library Functions							NOTE(3EXT)

NAME
NOTE, _NOTE - annotate source code with info for tools SYNOPSIS
#include <note.h> NOTE(NoteInfo); or #include<sys/note.h> _NOTE(NoteInfo); DESCRIPTION
These macros are used to embed information for tools in program source. A use of one of these macros is called an "annotation". A tool may define a set of such annotations which can then be used to provide the tool with information that would otherwise be unavailable from the source code. Annotations should, in general, provide documentation useful to the human reader. If information is of no use to a human trying to under- stand the code but is necessary for proper operation of a tool, use another mechanism for conveying that information to the tool (one which does not involve adding to the source code), so as not to detract from the readability of the source. The following is an example of an annotation which provides information of use to a tool and to the human reader (in this case, which data are protected by a particular lock, an annotation defined by the static lock analysis tool lock_lint). NOTE(MUTEX_PROTECTS_DATA(foo_lock, foo_list Foo)) Such annotations do not represent executable code; they are neither statements nor declarations. They should not be followed by a semi- colon. If a compiler or tool that analyzes C source does not understand this annotation scheme, then the tool will ignore the annotations. (For such tools, NOTE(x) expands to nothing.) Annotations may only be placed at particular places in the source. These places are where the following C constructs would be allowed: o a top-level declaration (that is, a declaration not within a function or other construct) o a declaration or statement within a block (including the block which defines a function) o a member of a struct or union. Annotations are not allowed in any other place. For example, the following are illegal: x = y + NOTE(...) z ; typedef NOTE(...) unsigned int uint ; While NOTE and _NOTE may be used in the places described above, a particular type of annotation may only be allowed in a subset of those places. For example, a particular annotation may not be allowed inside a struct or union definition. NOTE vs _NOTE Ordinarily, NOTE should be used rather than _NOTE, since use of _NOTE technically makes a program non-portable. However, it may be inconve- nient to use NOTE for this purpose in existing code if NOTE is already heavily used for another purpose. In this case one should use a different macro and write a header file similar to /usr/include/note.h which maps that macro to _NOTE in the same manner. For example, the following makes FOO such a macro: #ifndef _FOO_H #define _FOO_H #define FOO _NOTE #include <sys/note.h> #endif Public header files which span projects should use _NOTE rather than NOTE, since NOTE may already be used by a program which needs to include such a header file. NoteInfo Argument The actual NoteInfo used in an annotation should be specified by a tool that deals with program source (see the documentation for the tool to determine which annotations, if any, it understands). NoteInfo must have one of the following forms: NoteName NoteName(Args) where NoteName is simply an identifier which indicates the type of annotation, and Args is something defined by the tool that specifies the particular NoteName. The general restrictions on Args are that it be compatible with an ANSI C tokenizer and that unquoted parentheses be balanced (so that the end of the annotation can be determined without intimate knowledge of any particular annotation). ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |MT-Level |Safe | +-----------------------------+-----------------------------+ SEE ALSO
note(4), attributes(5) SunOS 5.11 31 Dec 1996 NOTE(3EXT)
All times are GMT -4. The time now is 10:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy