Sponsored Content
Full Discussion: help need in filtering data
Top Forums Shell Programming and Scripting help need in filtering data Post 302255196 by user_prady on Thursday 6th of November 2008 04:05:23 AM
Old 11-06-2008
help need in filtering data

Hello Gurus,

Please help me out of the problem. I ve a input file as below
Code:
  input clock;
  input a; //reset all
  input [9:0] b;

  //input comment
  output c;
  output d;
  output [1:0] e;
  input   [4:0] f;
  //output comment

I need the output as follows:

Code:
\\Inputs
clock
a
b
f[4:0]
\\Outputs
c
d
e[1:0]

I tried with the following code:
Code:
gawk '\
  {
  gsub(/(^ *|^\t)/, "", $0) \\ for cutting one or more space OR tab
  if( match($0,/^input/) ){
          print $0 > "del1"
  }
  if( match($0,/^output/) ){
          print $0 > "del2"
  }
}' file

then merge del1 & del2 perhaps would give the output. then I need to delete the files del1 and del2.

Is there any other simple way ?Smilie

Waitting for your reply
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Filtering out data ...

I have following command which tells me File size in GBs which are greater than 0.01GBs recursively in a dir structure. ls -l -R | awk '{ if ($5/1073741824 >= 0.01) print $9, $5/1073741824 }' But there are some files whom I dont have enough permissions, after executing this script gives me... (1 Reply)
Discussion started by: videsh77
1 Replies

2. Shell Programming and Scripting

Filtering Data

Hi All, I have the below input and expected ouput. I need a code which can scan through this input file and if the number in column1 is more than 1 , it will print out the whole line, else it will output "No Re-occurrence". Can anybody help ? Input: 1 vvvvv 20 7 7 23 0 64 6 zzzzzz 11 5... (7 Replies)
Discussion started by: Raynon
7 Replies

3. UNIX for Dummies Questions & Answers

Filtering Data

file1 contain: (this just a small sample of data it may have thousand of lines) 1 aaa 1/01/1975 delhi 2 bbb 2/03/1977 mumbai 3 ccc 1/01/1975 mumbai 4 ddd 2/03/1977 chennai 5 aaa 1/01/1975 kolkatta 6 bbb 2/03/1977 bangalore program: nawk '{ idx= $2 SUBSEP $3 arr = (idx in arr) ?... (2 Replies)
Discussion started by: bobo
2 Replies

4. Shell Programming and Scripting

Filtering data using AWK

Hi , i have file with delimiter as "|" and data in Double codes for all fields. how to filter data in a column like awk -F"|" '$1="asdf" {print $0}' test. ex : "asdf"|"zxcv" Thanks, Soma (1 Reply)
Discussion started by: challamsomu
1 Replies

5. Shell Programming and Scripting

awk data filtering

I am trying to filter out some data with awk. If someone could help me that would be great. Below is my input file. Date: 10-JUN-12 12:00:00 B 0: 00 00 00 00 10 00 16 28 B 120: 00 00 00 39 53 32 86 29 Date: 10-JUN-12 12:00:10 B 0: 00 00 00 00 10 01 11 22 B 120: 00 00 00 29 23 32 16 29... (5 Replies)
Discussion started by: thibodc
5 Replies

6. Homework & Coursework Questions

awk - filtering data by if --> into an array

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: my data in csv-format ... ... 13/08/2012,16:30,303.30,5.10,3,2,2,1,9360.0,322... (13 Replies)
Discussion started by: IMPe
13 Replies

7. Shell Programming and Scripting

Filtering data using uniq and sed

Hello, Does anyone know an easy way to filter this type of file? I want to get everything that has score (column 2) 100.00 and get rid of duplicates (for example gi|332198263|gb|EGK18963.1| below), so I guess uniq can be used for this? gi|3379182634|gb|EGK18561.1| 100.00... (6 Replies)
Discussion started by: narachaid
6 Replies

8. Shell Programming and Scripting

Filtering out the data with dates

Hi, I have some data like seen below. format : apple(hhmm mm/dd).fruit apple(2345 03/25).fruit apple(2345 05/06).fruit orange(0443 05/02).fruit orange(0345 05/05).fruit orange(2134 05/04).fruit grape(0930 04/24).fruit grape(2330 03/30).fruit I need to get the data which are... (1 Reply)
Discussion started by: jayadanabalan
1 Replies

9. Shell Programming and Scripting

Data filtering and category assigning

Please consider the following file, I have many groups which can be of 3 types, T1 (Serial_Number 1) T2 (Serial_Number 2) and T1*T2 (all other Serial_Number). I want to only consider groups that have both T1 and T2 present and their values are different from each other. In the example file,... (8 Replies)
Discussion started by: jianp83
8 Replies

10. Shell Programming and Scripting

Need help Filtering Data from an API

Hi Everyone, I need help on figuring out a way to filter some data that I get back from an API. Im able to get all the data that Im looking for but I would like to know a way for me to filter it better. The data that Im getting back is basically 2 rows of data as seen here. Row 1 ... (25 Replies)
Discussion started by: TheStruggle
25 Replies
findmsg(1)						      General Commands Manual							findmsg(1)

NAME
findmsg, dumpmsg - create message catalog file for modification SYNOPSIS
sym] sym]] file ... file ... DESCRIPTION
The command extracts messages from a C program source file and writes them to the standard output in a format suitable for input to (see gencat(1)). The input file will be preprocessed using (see cpp(1)) in order to select print specifiers and handle conditional primitives. If multiple input files are specified and the option is not used, the files are processed sequentially such that message catalog comment lines identifying the input file are written before the output for each input file. The command scans the source files for uncommented lines with one of the following three formats embedded within it: or any combination of these formats wholly contained on a single physical line. could be a string constant or a combination of string con- stants and print specifiers (PRI*). Any number of spaces or tabs can separate the comment from the message. The digit n, which can be any valid message number (see gencat(1)), is combined with the message string to produce a message catalog source line. The message source line is assigned to the set whose number is the current value of as set by the last directive encountered. If has not yet been defined when a message line is found, the message is output without a set number specification. If more than one message is found belonging to the same set and message number, the last message found is output; any others are silently discarded. Conditional compilation and instructions in the C source files are ignored. Options recognizes the following command-line options: Merge identically numbered sets from multiple input files so that can process the output. Define symbol sym. Cause symbol sym to be undefined. Consider all #ifdefs to extract messages from the input file. Options and will be used to select print specifiers if this option is not used. Outputs all error messages issued by By default, does not display the error messages issued by The command extracts messages from a message catalog file created by Messages are written to standard output in a format suitable for edit- ing and re-input to EXTERNAL INFLUENCES
Environment Variables determines the interpretation of messages as single-byte and/or multi-byte characters. determines the language in which messages are displayed. If or is not specified in the environment or is set to the empty string, the value of is used as a default for each unspecified or empty variable. If is not specified or is set to the empty string, a default of (see lang(5)) is used instead of If any internationalization variable contains an invalid setting, and behave as if all internationalization variables are set to See environ(5). International Code Set Support Single-byte and multi-byte character code sets are supported. WARNINGS
The and commands are HP proprietary, not portable to other vendors' systems, and will not be provided in future HP-UX releases. AUTHOR
and were developed by HP. SEE ALSO
findstr(1), gencat(1), insertmsg(1), catgets(3C). findmsg(1)
All times are GMT -4. The time now is 05:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy