473,406 Members | 2,439 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

perl pattern matching

Hello,

please Can anyone help me to get the below output.

My input file looks like this:
--------------------------------------------------------------------------------------------------------------------
SCWS "PA:SYSTEM_TEST" /DIRECTORY="D:\SYSTEM_TEST\" /NODEFAULT
RI "PA:PSP_0571.A-FILE;na#25" /USER_FILENAME="D:\HOT\SCMR\SYSTEM_TEST\build\Auto2 .txt" /COMMENT="revision"
FI "PA:PSP_0571.A-FILE" /USER_FILE="D:\SYSTEM_TEST\build\Auto2.txt"
BI "PSP_9728.A-FILE" /PART="PA:SYSTEM_TEST.Z" /WS_FILENAME="build\BSM_46_01.txt" /FILENAME="a901-01.txt"

SCWS "PA:SYSTEM_TEST" /DIRECTORY="D:\SYSTEM_TEST\" /NODEFAULT
--------------------------------------------------------------------------------------------------------------------


I wish to see a code that does the following:

If line starts with RI "whatever" otherstuff then outputs an additional line
containing "AI "whatever" set"
If line starts with BI "whatever" otherstuff then outputs an additional line
containing "AI "whatever" set"


Many Thanks in Advance.
Aug 6 '08 #1
1 1005
KevinADC
4,059 Expert 2GB
Do you know any perl? What have you tried so far?
Aug 6 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Bob | last post by:
why is perl referred to as a CGI script and not php, php has the facility to execute backticked execute commands that enable the programmer to use operating system facilities as well ? why...
176
by: Thomas Reichelt | last post by:
Moin, short question: is there any language combining the syntax, flexibility and great programming experience of Python with static typing? Is there a project to add static typing to Python? ...
1
by: Xah Lee | last post by:
suppose you want to do find & replace of string of all files in a directory. here's the code: ©# -*- coding: utf-8 -*- ©# Python © ©import os,sys © ©mydir= '/Users/t/web'
9
by: Xah Lee | last post by:
# -*- coding: utf-8 -*- # Python # Matching string patterns # # Sometimes you want to know if a string is of # particular pattern. Let's say in your website # you have converted all images...
31
by: surfunbear | last post by:
I've read some posts on Perl versus Python and studied a bit of my Python book. I'm a software engineer, familiar with C++ objected oriented development, but have been using Perl because it is...
4
by: Xah Lee | last post by:
20050207 text pattern matching # -*- coding: utf-8 -*- # Python # suppose you want to replace all strings of the form # <img src="some.gif" width="30" height="20"> # to # <img...
75
by: Xah Lee | last post by:
http://python.org/doc/2.4.1/lib/module-re.html http://python.org/doc/2.4.1/lib/node114.html --------- QUOTE The module defines several functions, constants, and an exception. Some of the...
1
by: Chris Newman | last post by:
I am working on a script to process a large number of old electoral records. There are about 100,000 records in all but here is a representative sample BTW hd =household duties ALLISON,...
1
by: anderz1985 | last post by:
I am stuck on a question which is asking me to write a perl script that passes a data file matching perl script. Wil be thankful for any help james
2
by: ravir | last post by:
Hi, I am new to this group. I am working in Perl and shellscripts. I have a clarification regarding perl grep and pattern matching. I am writing a perl script to automate the process of code...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.