Sponsored Content
Top Forums Shell Programming and Scripting Changing file content in perl Post 302892288 by Syed Imran on Wednesday 12th of March 2014 01:30:51 AM
Old 03-12-2014
Wrench

Thanks for the help,

but i have a file content like this,

Code:
#==============================================================

#<clear_category_list>

#<include file="SUITE:Security-Security.inc">

#<include file="CAT:SYSTEM:U75_U23.inc">
#<include file="CAT:PRIORITY:1.inc">
#<include file="CAT:FAC_TYPE:DEFAULT.inc">
#<include file="CAT:CARD_TYPE:MPMA-SHP3.inc">
#<include file="CAT:BOARD_TYPE:cpp8548.inc">
#<include file="CAT:SCHEDULER:3.inc">

#-------------------------------------------------------------- 

#<testcase_begin testcase_id="U75_U23_User_Security_Test">
 testcase_title="U75_U23 User Security Test">

#<testcase_requirements requirement_id="REGRESSION_REQ_ID">
#<testcase_script script="run_regression_usersec  -findboard ${BOARD_TYPE} -next -stop -var SYSTEM ${CATEGORY_SYSTEM} -schedule +${SCHEDULER}h ">

#<testcase_objectives_begin>
test the FEATUREGROUP feature for FEATURE for CARDTYPE
#<testcase_objectives_end>

#<testcase_setup_begin>
#<testcase_setup_end>

#<testcase_procedure_begin>
#<testcase_procedure_end>

#<testcase_expected_results_begin>
#<testcase_expected_results_end>

#<testcase_end>


#==============================================================

#<clear_category_list>

#<include file="SUITE:SAS_HK_MR537_Reg.inc">

#<include file="CAT:SYSTEM:SAS_U23.inc">
#<include file="CAT:PRIORITY:1.inc">
#<include file="CAT:FAC_TYPE:DEFAULT.inc">
#<include file="CAT:CARD_TYPE:DEFAULT.inc">
#<include file="CAT:BOARD_TYPE:cpp8548.inc">
#<include file="CAT:SCHEDULER:1.inc">

#-------------------------------------------------------------- 

#<testcase_begin testcase_id="SAS_U23_HK_MR537_Regression_Test">
 testcase_title="SAS_U23 HK MR537 Regression">

#<testcase_requirements requirement_id="REGRESSION_REQ_ID">
#<testcase_script script="run_regression_hk_r71  -findboard ${BOARD_TYPE} -next  -stop -var SYSTEM ${CATEGORY_SYSTEM} -schedule +${SCHEDULER}h ">

#<testcase_objectives_begin>
test the FEATUREGROUP feature for FEATURE for FACTYPE
#<testcase_objectives_end>

#<testcase_setup_begin>
#<testcase_setup_end>

#<testcase_procedure_begin>
#<testcase_procedure_end>

#<testcase_expected_results_begin>
#<testcase_expected_results_end>

#<testcase_end>


wheer i should search for the testcase based on the various "testcase_begin testcase_id" present, and then move up to search the keyword PRIORITY:10 or any number and then change it as PRIORITY:3

And then find the count.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Need help with changing bash to perl

Hi guys, I am converting a bash script to perl. I need lots of help and pointers on how to make the script work. Any help would be greatly appreciated. Here is what I have: #!/usr/bin/perl #Decrypt Files $dir = "/usr/bin/gpg; opendir(PGP_DIR, $dir) || die "can't opendir $dir: $!";... (3 Replies)
Discussion started by: freak
3 Replies

2. Shell Programming and Scripting

file content in an array PERL

Hello everybody, I'm new in this forum. I searched a long time for a solution for my problem but I didn't find the right thing. I have to read from a file (content is "abngjm" without any other signs) and have to write this content in an array. But every sign has to be called by its own... (5 Replies)
Discussion started by: e_prof
5 Replies

3. Shell Programming and Scripting

Perl search and replace file content.

I am not sure if this is doable. I am trying to open and print the content of the file by replacing all instances fo perl to PERL . This is my code but it is giving me the number count instead of the actual lines with changes. open (PERLHISTORY, 'sample.txt') or die "The file sample.txt could... (3 Replies)
Discussion started by: jxh461
3 Replies

4. UNIX for Dummies Questions & Answers

Changing file content based on file header

Hi, I have several text files each containing some data as shown below: File1.txt >DataHeader Data... Data... File2.txt >DataHeader Data... Data... etc. What I want is to change the 'DataHeader' based on the file name. So the output should look like: File1.txt >File1 ... (1 Reply)
Discussion started by: Fahmida
1 Replies

5. Shell Programming and Scripting

changing files content with sed or awk

Hi, Example File: (jumped, bumped, ) how to jumped, FROM tree; EXIT I have some hundreads of files like this with the different words and I want to remove the comma before the bracket and also I have to remove the comma before FROM word. I am trying to use this command : awk '... (5 Replies)
Discussion started by: rajshashi
5 Replies

6. Shell Programming and Scripting

Need Help!!! For changing the content of the line

I need to change the content of the line after I grep it. The line is : Date SNWD.I-1 (in) WTEQ.I-1 (in) PREC.I-1 (in) TOBS.I-1 (degC) TMAX.D-1 (degC) TMIN.D-1 (degC) TAVG.D-1 (degC) I want to change the second column (SNWD.I-1(in)) to SNWD.I-1(m), how could I do that? I use csh... (2 Replies)
Discussion started by: handsonzhao
2 Replies

7. Shell Programming and Scripting

perl extract content of file

I'm using Mail::Internet module, which will basically filter through email content and extract the body of the message my perl script to extract the body of the email #!/usr/bin/perl -w use Mail::Internet; @lines = <STDIN>; $mi_obj = new Mail::Internet(); ... (2 Replies)
Discussion started by: amlife
2 Replies

8. Shell Programming and Scripting

Sed: replace content from file with the content from file

Hi, I am having trouble while using 'sed' with reading files. Please help. I have 3 files. File A, file B and file C. I want to find content of file B in file A and replace it by content in file C. Thanks a lot!! Here is a sample of my question. e.g. (file A: a.txt; file B: b.txt; file... (3 Replies)
Discussion started by: dirkaulo
3 Replies

9. Shell Programming and Scripting

Perl SCript to read file content (if else statemenet)

Hi All, I wanted to write a perl script to read the content in a file,the file content is either 0 (zero) OR 1. The idea is like this. If (content =1), then it will proceed to perform some step. and then update the file content to 0(zero) else if (content =0), it will update the content to... (11 Replies)
Discussion started by: hploh
11 Replies

10. Shell Programming and Scripting

How to remove exisiting file content from a file and have to append new file content?

hi all, i had the below script x=`cat input.txt |wc -1` awk 'NR>1 && NR<'$x' ' input.txt > output.txt by using above script i am able to remove the head and tail part from the input file and able to append the output to the output.txt but if i run it for second time the output is... (2 Replies)
Discussion started by: hemanthsaikumar
2 Replies
ppmtosixel(1)                                                 General Commands Manual                                                ppmtosixel(1)

NAME
ppmtosixel - convert a portable pixmap into DEC sixel format SYNOPSIS
ppmtosixel [-raw] [-margin] [ppmfile] DESCRIPTION
Reads a portable pixmap as input. Produces sixel commands (SIX) as output. The output is formatted for color printing, e.g. for a DEC LJ250 color inkjet printer. If RGB values from the PPM file do not have maxval=100, the RGB values are rescaled. A printer control header and a color assignment table begin the SIX file. Image data is written in a compressed format by default. A printer control footer ends the image file. OPTIONS
-raw If specified, each pixel will be explicitly described in the image file. If -raw is not specified, output will default to com- pressed format in which identical adjacent pixels are replaced by "repeat pixel" commands. A raw file is often an order of magni- tude larger than a compressed file and prints much slower. -margin If -margin is not specified, the image will be start at the left margin (of the window, paper, or whatever). If -margin is speci- fied, a 1.5 inch left margin will offset the image. PRINTING
Generally, sixel files must reach the printer unfiltered. Use the lpr -x option or cat filename > /dev/tty0?. BUGS
Upon rescaling, truncation of the least significant bits of RGB values may result in poor color conversion. If the original PPM maxval was greater than 100, rescaling also reduces the image depth. While the actual RGB values from the ppm file are more or less retained, the color palette of the LJ250 may not match the colors on your screen. This seems to be a printer limitation. SEE ALSO
ppm(5) AUTHOR
Copyright (C) 1991 by Rick Vinci. 26 April 1991 ppmtosixel(1)
All times are GMT -4. The time now is 07:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy