Sponsored Content
Top Forums Shell Programming and Scripting Script to process a list of items and uncomment lines with that item in a second file Post 303042870 by RudiC on Thursday 9th of January 2020 03:54:42 AM
Old 01-09-2020
Try


Code:
awk -v"SQ='" '
FNR == NR       {PAT[NR]="^C.*" SQ $0 SQ
                 MX = NR
                 next
                }
                {for (i=1; i<=MX; i++) if ($0 ~ PAT[i]) {sub (/^./,_)
                                                         break
                                                        }
                }
1
' list_file modify_file

This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

retrieve what the currently selected item is in a dropdown select list using perl tk

I have a dropdown menu built in perl tk (I am using active state perl). I want to select a value from the dropdown menu and I want to be able to perform some other actions depending upon what value is selected. I have all the graphical part made but I dont know how to get the selected value. Any... (0 Replies)
Discussion started by: lassimanji
0 Replies

2. Shell Programming and Scripting

comment and uncomment a line with Shell Script

Requirement is: 1. comment and uncomment the line with Shell Script: /opt/admin/fastpg/bin/fastpg.exe -c -=NET (using fastpg.exe as a search option) 2. display = "Commented" (when its commented) and display = "Uncommented" (when its uncommented) Its urgent, please let me asap!!! Thanks in... (2 Replies)
Discussion started by: anthonyraj75
2 Replies

3. Shell Programming and Scripting

Help needed regarding first 3 items in the list

Hi, I've a list in the following format: Empdept filedetails buildingNo Area AAA 444 2 juy AAA 544 2 kui AAA 567 4 poi AAA 734 5 oiu AAA 444 ... (2 Replies)
Discussion started by: skpvalvekar
2 Replies

4. Shell Programming and Scripting

List content of item in the combobox

I have a combo.cgi here. this is linux environment What i am going to do is this combobox will list down all the flatfile name in this /u/test/cgi-bin/List directory. after that, i wanted it to open the flatfile and display the content of the flatfile into another listbox or textarea in this page... (0 Replies)
Discussion started by: chezy
0 Replies

5. Shell Programming and Scripting

[Perl] Split lines into array - variable line items - variable no of lines.

Hi, I have the following lines that I would like to see in an array for easy comparisons and printing: Example 1: field1,field2,field3,field4,field5 value1,value2,value3,value4,value5Example 2: field1,field3,field4,field2,field5,field6,field7... (7 Replies)
Discussion started by: ejdv
7 Replies

6. Shell Programming and Scripting

Removing lines from a file being used by another process using SHELL script

Hi All, Need a small help in writing a shell script which can delete a few lines from a file which is currently being used by another process. File gets appended using tee -a command due to which its size is getting increased. Contents like : 25/09/2012 05:18 Run ID:56579677-1 My... (3 Replies)
Discussion started by: nikhil8
3 Replies

7. UNIX for Dummies Questions & Answers

Easiest way to comment/uncomment a shell script?

cd path line1 line2 line3 line4 line5 Lets say thats the sample script...So say if i have to comment the above script, which would be the better way so that whenever i want, i cud comment or uncomment the same. Thanks (1 Reply)
Discussion started by: saggiboy10
1 Replies

8. Shell Programming and Scripting

Need help with a script to grep items in one file from another file

I have one master file "File1" with all such info in it. I need to grep each object under each list from another file "File2". Can anyone help me with a script for this. File 1 ------ List 1 Object 1 Object 2 List 2 Object 3 Object 1 List 3 Object 2 ... (5 Replies)
Discussion started by: Sam R
5 Replies

9. Shell Programming and Scripting

Read a lis, find items in a file from the list, change each item

Hello, I have some tab delimited text data, file: final_temp1 aname val NAME;r'(1,) 3.28584 r'(2,)<tab> NAME;r'(3,) 6.13003 NAME;r'(4,) 4.18037 r'(5,)<tab> You can see that the data is incomplete in some cases. There is a trailing tab after the first column for each incomplete row. I... (2 Replies)
Discussion started by: LMHmedchem
2 Replies

10. Shell Programming and Scripting

Pass an array to awk to sequentially look for a list of items in a file

Hello, I need to collect some statistical results from a series of files that are being generated by other software. The files are tab delimited. There are 4 different sets of statistics in each file where there is a line indicating what the statistic set is, followed by 5 lines of values. It... (8 Replies)
Discussion started by: LMHmedchem
8 Replies
LIBPAT(3)						     cao-vlsi reference manual							 LIBPAT(3)

ORIGIN
This software belongs to the ALLIANCE CAD SYSTEM developed by the ASIM team at LIP6 laboratory of Universite Pierre et Marie CURIE, in Paris, France. Web : http://asim.lip6.fr/recherche/alliance/ E-mail : alliance-users@asim.lip6.fr NAME
PAT - Generic pattern data structure DESCRIPTION
PAT is a generic data structure supporting vlsi concepts. It allows representation of a sequence of simulation patterns in a data struc- ture. The goal of PAT is to define an ad hoc single data structure (object), with well known fixed meaning for each concept manipulated in pat- tern description. So any tools that needs to access simulation patterns can be build upon it, using these structures. For each object (data structure), a set of functions has been defined in order to add, delete or access it. These functions are defined in a low-level library libPat106.a. Some other functions are higher level. They are defined in a high-level library libPhl106.a. There are also some parsers-drivers. A parser reads a pattern description file in a given format and build up a complete PAT data base. A driver creates a text file in a given format from a PAT data base. A pat format parser-driver is available in the libPpt106.a library. Pattern description envolves the following notions (for further details see pat(5)): input port controlled by the user output signal or port observed by the user initialization forcing the value of a register pattern sequence list of values to be forced on inputs or to be checked as the result of the simulation on outputs The input-output list is represented by two data structures: pagrp contains informations relative to actual or virtual arraies and, paiol represents a one-bit input-output. Both are simply chained lists. However, to make a more efficient access to paiol structures, they are organized in a table. So, a paiol can also be addressed using an offset. Another group of data structures is used to represent a pattern. paini contains values to be forced into registers before processing the pattern. An event (a modification of value) on an input-output is given by a paevt structure. A third structure, papat gathers all infor- mation concerning a pattern (including initializations - paini - and events - paevt). A pacom is used to represent a comment. Finally, all these structures can be accessed through a unique structure, paseq, designed to represent a complete sequence of simulation patterns. ORGANIZATION
In order to use PAT, concepts on use of libraries are needed. And, since these libraries are under development, the code is subject to change. To enable work, a static version of each library is always present for the user. Libraries and header files are suffixed by a number (the library's version). The programmer can prefer to work with an earlier version of a library rather than the most recent one. However, it is recommended to adapt softwares to libraries as soon as possible in order to spotlight potential compatibility problems before old libraries are removed. A makefile is necessary for all PAT applications. This is required because any soft must be easily recompilable, and knowing the needed libraries for a PAT based program is not an easy matter. It can't be achieved by an other way, so do use makefile. In terms of software organization, PAT is splitted into two libraries for the basic functions, a header file for structures and variable declarations and, up to now, one parser-driver library for pat format. It is to be noticed that library's version number is incremented when, at least, one function composing the library has been modified. Therefore, PAT libraries may evolve independently form each other. Here follows the list of the libraries and their contents. libPat106.a: pat_addpaseq, pat_addpagrp, pat_addpaiol, pat_addpapat, pat_addpaevt, pat_addpaini, pat_addpacom, pat_frepaini, pat_frepaiol, pat_frepacom, pat_frepapat, pat_frepaevt, pat_crtpaiol libPhl106.a: pat_debug, pat_getcount libPpt106.a: pat_lodpaseq, pat_savpaseq, pat_drvpat, pat_prspat The libraries are organized in such a way that no cycle can appear through calls. It means that, if in a given library a function calls another function in another library, then none of the functions of this one does call any function that belongs to the first library. EXAMPLE
In order to use PAT libraries, one needs something like this in its makefile: HEADER = -I/labo/include LIB = -L/labo/lib -lPat106 -lPhl106 -lPpt106 -lMut315 SEE ALSO
mbk(1), pat(5) BUG REPORT
This tool is under development at the ASIM department of the LIP6 laboratory. We need your feedback to improve documentation and tools. ASIM
/LIP6 October 1, 1997 LIBPAT(3)
All times are GMT -4. The time now is 11:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy