filter input & outputs to another file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting filter input & outputs to another file
# 1  
Old 11-04-2008
filter input & outputs to another file

Hello All,

I am stuck with the follwing problem , pls give me some advice..

Input file:
Code:
  input clock;
  input reset; \\reset all
  input [9:0] yuv;

  //input comment
  output sur;
  output sud;
  output [1:0] vtua;
  output [8:0] tur;
  input   [4:0] ebi;
  //output comment

The input file has some input & output pins. And the statement can start with one or more spaces OR one or more tabs.

Output file:
Code:
\\Inputs
clock 
reset
yuv[9:0]
ebi[4:0]
\\Outputs
sur
sud
vtua[1:0]
tur[8:0]

I tried with the followin but not yet suceded.
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

Regards,
prady
# 2  
Old 11-05-2008
Help need to filter data

If the problem is not clear pls let me know..

Thanks in advance.

Regards,
prady
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

CSV File:Filter duplicate records from column1 & another column having unique record

Hi Experts, I have csv file with 30, 40 columns Pasting just 2 column for problem description. Need to print error if below combination is not present in file check for column-1 (DocumentNumber) and filter columns where value in DocumentNumber field is same. For all such rows, the field... (7 Replies)
Discussion started by: as7951
7 Replies

2. Shell Programming and Scripting

Read input while another command is running &&

This script runs tshark, then displays the output. I want to read a keypress at all times throughout this script, especially during the 10 seconds that tshark is running. This code however, only takes input before tshark runs. #!/bin/bash main() { while (( "1" == "1" )) ; do keypress &&... (3 Replies)
Discussion started by: Kiah07
3 Replies

3. UNIX for Dummies Questions & Answers

Cat Input & Output to a Log file

Team, we use below command to store the contents in a logfile. cat a.txt > a.log a.txt content is 123 345 Is there any options available to store the command used also? for eg a.log may show as cat a.txt 123 345 (5 Replies)
Discussion started by: sid2013
5 Replies

4. Shell Programming and Scripting

Search & Replace in Multiple Files by reading a input file

I have a environment property file which contains: Input file: value1 = url1 value2 = url2 value3 = url3 and so on. I need to search all *.xml files under directory for value1 and replace it with url1. Same thing I have to do for all values mentioned in input file. I need script in unix bash... (7 Replies)
Discussion started by: Shamkamde
7 Replies

5. Shell Programming and Scripting

How-To Check & Filter user input

Hi, On my Java webpage which invokes the shell script has two checkboxes viz ... apache and weblogic apache require one parameter i.e apache home from the user while Weblogic requires three or five params from the user vi.z weblogic_home or <jdk_home, config_home & pid>, username and... (4 Replies)
Discussion started by: mohtashims
4 Replies

6. Shell Programming and Scripting

How to filter date input in awk?

Hi, I've no problems filtering text in awk but whenever I try to filter date format such as 03022013, I couldn't get awk to filter the item out. Any tips? (8 Replies)
Discussion started by: commonwealth
8 Replies

7. Shell Programming and Scripting

Keeping std & err outputs alive and feed one log file in a one-shot way

Bonjour, I have a large script with a lot of print statements and misc commands. Standard and error outputs are redirected like into the following code : #!/usr/bin/ksh LOG=/<some dir>/log > $LOG exec >>${LOG} 2>>${LOG} print aaaaa print bbbbb print ccccc ... some_cmd That way,... (5 Replies)
Discussion started by: Fundix
5 Replies

8. Shell Programming and Scripting

Search & Replace in Multiple Files by reading a input file

Hi, I have a folder which contains multiple config.xml files and one input file, Please see the below format. Config Files format looks like :- Code: <application name="SAMPLE-ARCHIVE"> <NVPairs name="Global Variables"> <NameValuePair> ... (0 Replies)
Discussion started by: haiksuresh
0 Replies

9. UNIX for Dummies Questions & Answers

Using input file to filter data from another file

I have a data file: abc Text Text Text Unique Text 123 Text word Line Unique Text fgh Text data Line Unique Text 789 Text Text Line Unique Text 543 Text Text Data Unique Text and a filter file 123 789 I want to extract out from the data file the two records that contain the keys... (1 Reply)
Discussion started by: tumblez
1 Replies

10. Shell Programming and Scripting

How to prompt for input & accept input in ONE line

hi, am a new learner to shell programming. i have a script which will prompt for user to key in their name & display their name afterwards. script ===== echo "Pls enter your name:" read name echo "Your name is $name." output ===== Pls enter your name: Bob Your name is Bob. what... (2 Replies)
Discussion started by: newbie168
2 Replies
Login or Register to Ask a Question