Sponsored Content
Top Forums Shell Programming and Scripting AWK script problem insertion of code Post 302503597 by jaita on Friday 11th of March 2011 10:26:05 AM
Old 03-11-2011
AWK script problem insertion of code

Hi ,

I am having two files like this

Code:
 
FILE1 
####################
 
input SI_TESTONLY_R_00;
input CE0_SE_INPUT_TESTONLY;
input CE0_TCLK_TESTONLY;
input SI_JTGCLOCKDR_JTAG_R_00;
input CE0_TCLK_JTGCLOCKDR_JTAG;
input CE0_SE_INPUT_JTGCLOCKDR_JTAG;
output SO_TESTONLY_R_00;
output SO_JTGCLOCKDR_JTAG_R_00;

#######################

FILE2
Code:
 
#########################
 
SDFFQ_X1M_A9TH P1_sdflop (
.CK (P2)
.D (1'b0),
.SI (P1),
.SE (P3),
.Q (P1_INT_NET));
 
LATNQ_X1M_A9TH P1_lockup (
 .GN (P2),
.D (P1_INT_NET),
.Q (P5));

#########################


Now FILE1 is very big file having lots of pins like this
Need to match the pattern SI_TESTONLY with other same kind of patterns pins CE0_SE_INPUT_TESTONLY and CE0_TCLK_TESTONLY

and insert the code from the second file into the First File with the replacement
P1 : SI_* Pin
P2 :CE0_TCLK* Pin
P3: CE0_SE_INPUT* Pin
P5: SO_TESTONLY_R_00 Pin

OUTPUT FILE
Smilie
Code:
 
########################
 
input SI_TESTONLY_R_00;
input CE0_SE_INPUT_TESTONLY;
input CE0_TCLK_TESTONLY;
input SI_JTGCLOCKDR_JTAG_R_00;
input CE0_TCLK_JTGCLOCKDR_JTAG;
input CE0_SE_INPUT_JTGCLOCKDR_JTAG;
output SO_TESTONLY_R_00;
output SO_JTGCLOCKDR_JTAG_R_00;
 
SDFFQ_X1M_A9TH SI_TESTONLY_R_00_sdflop (
.CK (CE0_TCLK_TESTONLY)
.D (1'b0),
.SI (SI_TESTONLY_R_00),
.SE (CE0_SE_INPUT_TESTONLY),
.Q (SI_TESTONLY_R_00_INT_NET));
 
LATNQ_X1M_A9TH P1_lockup (
 .GN (CE0_TCLK_TESTONLY),
.D (SI_TESTONLY_R_00_INT_NET),
.Q (SO_TESTONLY_R_00));


SDFFQ_X1M_A9TH SI_JTGCLOCKDR_JTAG_R_00_sdflop (
.CK (CE0_TCLK_JTGCLOCKDR_JTAG)
.D (1'b0),
.SI (SI_JTGCLOCKDR_JTAG_R_00),
.SE (CE0_SE_INPUT_JTGCLOCKDR_JTAG),
.Q (SI_JTGCLOCKDR_JTAG_R_00_INT_NET));
 
LATNQ_X1M_A9TH P1_lockup (
 .GN (CE0_TCLK_JTGCLOCKDR_JTAG),
.D (SI_JTGCLOCKDR_JTAG_R_00_INT_NET),
.Q (SO_JTGCLOCKDR_JTAG_R_00));

I tried to used the array variables but could not build the relevant script on this issue

Please help me out on this

Thanks

Jaita

---------- Post updated at 10:26 AM ---------- Previous update was at 03:22 AM ----------

Anyone Can please help me out in this particular issue

Thanks
Jaita
 

10 More Discussions You Might Find Interesting

1. AIX

problem with Unicode characters insertion

hi, I have a problem with unicode chars ( chinese, japanese etc ) insertion using sqlplus prompt. When i wrote a proc program for it i am able to create records. But when i fore the same query on sql prompt it stores reverse ????? ..some junk. widechar columns are mapped with NVARCHAR datatype.... (0 Replies)
Discussion started by: suman_jakkula
0 Replies

2. Shell Programming and Scripting

Problem with awk script

Hi Can anyone help me in this Problem File1 ######################### HOLI 123 AND ONE TWO THREE AMITABH SAMSUNG POLI AND TWO SENSE CRYING WING PPIN TBFLAG I B AND OROLE TB_HOT=" DCT" TB_CAT=" CAT" TC_NOT=" AND" +PIN TB=" HOT" TB_GATE=" KOT" TB_LATE=" MAT" TC=LOT MAT DAT SAT... (5 Replies)
Discussion started by: kshitij
5 Replies

3. Shell Programming and Scripting

Problem with a AWK Script

Hi I am having some contents in my file like this file1 ########################## pin (PIN1) { direction : input ; capacitance : 121 ; max_transition : 231 ; } pin (PIN2) { direction : input ; capacitance : 124 ; max_transition : 421 ;... (8 Replies)
Discussion started by: kshitij
8 Replies

4. Shell Programming and Scripting

insertion of text from sed script

Hi , This is my first thread ; facing some issues withmy sed script I need to insert the code from my log file which is between two keywords. content is like this ........ log ############################ log1 log2 231 "Ban" "tom" and the line one of the cross line friend... (2 Replies)
Discussion started by: shalini_008
2 Replies

5. Shell Programming and Scripting

zip code filter problem using AWK need help

Hello all; I have a large file (csv file) with addresses. I am trying to filter out specific entries based on zip code from a particular column of data. However my awk statement can not account for zipcode that begins with a certain pattern. It finds the pattern anywhere within the zipcode. ... (3 Replies)
Discussion started by: nelsonsierra
3 Replies

6. Shell Programming and Scripting

awk script problem

Hi, How to check status of the files in the awk script i am having two awk script in one bash script.Like -BELOW is the exact structure of the script script name: new.sh { awk -v v1=`.....` { if (){ exit -1; } } } }'$file name1 { awk -v v2=`.....` { if (){ ... (5 Replies)
Discussion started by: Ganesh Khandare
5 Replies

7. Shell Programming and Scripting

awk script problem

Hi I am having a big file where the interested section is shown below I need to write one awk script to search for the _N thing and delete it till the blank space means _N1 or _N4 everything needs to be deleted Removing the links like _N402 and like that ... (5 Replies)
Discussion started by: jaita
5 Replies

8. Shell Programming and Scripting

Need help in using sed/awk for line insertion in xml

Hello, I have two text files (txt1 and txt2). txt1 contains many lines with a single number in each line. txt2 (xml format) contains information about the numbers given in txt1. I need to insert one line in txt2 within the scope of each number taken from txt1. Sample problem: txt1: 12 23... (1 Reply)
Discussion started by: shekhar2010us
1 Replies

9. Shell Programming and Scripting

Awk/sed problem to write Db insertion statement

Hi There, I am trying to load data from a csv file into a DB during our DB migration phase. I am successfully able export all data into a .csv file but those have to rewritten in terms insert statement which will allow for further population of same data in different DB My exiting csv record... (6 Replies)
Discussion started by: bhaskar_m
6 Replies

10. UNIX for Beginners Questions & Answers

UNIX shell script for matrix insertion into a file

I have a script which is extracting data from a database in an excel file in below given format, date_time calling_app1 count of requests date calling_app x 34 date calling_app y 1034 I want to write a script which will write data into a file like this ... (3 Replies)
Discussion started by: TNT47
3 Replies
JOIN(1) 								FSF								   JOIN(1)

NAME
join - join lines of two files on a common field SYNOPSIS
join [OPTION]... FILE1 FILE2 DESCRIPTION
For each pair of input lines with identical join fields, write a line to standard output. The default join field is the first, delimited by whitespace. When FILE1 or FILE2 (not both) is -, read standard input. -a SIDE print unpairable lines coming from file SIDE -e EMPTY replace missing input fields with EMPTY -i, --ignore-case ignore differences in case when comparing fields -j FIELD (obsolescent) equivalent to `-1 FIELD -2 FIELD' -j1 FIELD (obsolescent) equivalent to `-1 FIELD' -j2 FIELD (obsolescent) equivalent to `-2 FIELD' -o FORMAT obey FORMAT while constructing output line -t CHAR use CHAR as input and output field separator -v SIDE like -a SIDE, but suppress joined output lines -1 FIELD join on this FIELD of file 1 -2 FIELD join on this FIELD of file 2 --help display this help and exit --version output version information and exit Unless -t CHAR is given, leading blanks separate fields and are ignored, else fields are separated by CHAR. Any FIELD is a field number counted from 1. FORMAT is one or more comma or blank separated specifications, each being `SIDE.FIELD' or `0'. Default FORMAT outputs the join field, the remaining fields from FILE1, the remaining fields from FILE2, all separated by CHAR. AUTHOR
Written by Mike Haertel. REPORTING BUGS
Report bugs to <bug-coreutils@gnu.org>. COPYRIGHT
Copyright (C) 2002 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU- LAR PURPOSE. SEE ALSO
The full documentation for join is maintained as a Texinfo manual. If the info and join programs are properly installed at your site, the command info join should give you access to the complete manual. join (coreutils) 4.5.3 February 2003 JOIN(1)
All times are GMT -4. The time now is 03:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy