Visit Our UNIX and Linux User Community

Top Forums Shell Programming and Scripting Regular Expression + Aritmetical Expression Post 21688 by irfan_yousuf on Tuesday 21st of May 2002 10:59:56 AM
Old 05-21-2002
yeah if u could be more specific by giving out an example of wht u want to do... i'm sure tht would be good enough to help u out and frankly spking i don't see any problem in wht u want to do... i'm sure it shd be possible
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

regular expression

Hello All! I have a file thats something like this: ( a grep output) /path/of/file/filename.abc.xyz.pqr:! Commented text /path/of/file/filename.abc.xyz: ! More Commented text I need to grep out those line from this file whose filename has ".abc" in the filename (anywhere in filename)... (3 Replies)
Discussion started by: ag79
3 Replies

2. Linux

Regular expression to extract "y" from "abc/x.y.z" .... i need regular expression

Regular expression to extract "y" from "abc/x.y.z" (2 Replies)
Discussion started by: rag84dec
2 Replies

3. UNIX for Dummies Questions & Answers

Regular expression help

HI All, I want to list a file with the below format : testfile_nnnnn.xxxx where n and x can be any digit 0-9. n repeats 5 times and x 4 times... I tried with something like below: ls -l testfile_/\{5\}/* to start with but its not working. Please could anyone help? Thanks D (1 Reply)
Discussion started by: deepakgang
1 Replies

4. Shell Programming and Scripting

Regular expression

Hi I have to extract the first field and the last %field of the following out put.. /home (/abc/def/bhd ) : 522328 total allocated Kb 319448 free allocated Kb ... (2 Replies)
Discussion started by: Harikrishna
2 Replies

5. Shell Programming and Scripting

regular expression (.*?)

hi all, i have a text file with below content ............................... ............................... ............................... ............................... %%Page: (4) 4 %%PageBoundingBox: 34 -30 584 831 %%BeginPageSetup %%BeginFeature: *PageSize A4 595 842... (7 Replies)
Discussion started by: uttamhoode
7 Replies

6. Shell Programming and Scripting

Regular expression Help

Hi What is the meaning of this in regular expression $k =~ s/^\s*//; Plz explain (3 Replies)
Discussion started by: Harikrishna
3 Replies

7. Shell Programming and Scripting

Integer expression expected: with regular expression

CA_RELEASE has a value of 6. I need to check if that this is a numeric value. if not error. source $CA_VERSION_DATA if * ] then echo "CA_RELESE $CA_RELEASE is invalid" exit -1 fi + source /etc/ncgl/ca_version_data ++ CA_PRODUCT_ID=samxts ++ CA_RELEASE=6 ++ CA_WEEK_NO=7 ++... (3 Replies)
Discussion started by: ketkee1985
3 Replies

8. Shell Programming and Scripting

help in regular expression

<ATTR name="ABCDEFGH" value=""/> <ATTR name="HJYR" value=""/> what would be the regular expression to match both the above strings... Always end with value=""/> always start with <ATTR name=" the ATTR name can be anything.. I need to use this with match() in awk. Thanks.. (1 Reply)
Discussion started by: shekhar2010us
1 Replies

9. Programming

Perl: How to read from a file, do regular expression and then replace the found regular expression

Hi all, How am I read a file, find the match regular expression and overwrite to the same files. open DESTINATION_FILE, "<tmptravl.dat" or die "tmptravl.dat"; open NEW_DESTINATION_FILE, ">new_tmptravl.dat" or die "new_tmptravl.dat"; while (<DESTINATION_FILE>) { # print... (1 Reply)
Discussion started by: jessy83
1 Replies

10. UNIX for Advanced & Expert Users

sed: -e expression #1, char 0: no previous regular expression

Hello All, I'm trying to extract the lines between two consecutive elements of an array from a file. My array looks like: problem_arr=(PRS111 PRS213 PRS234) j=0 while } ] do k=`expr $j + 1` sed -n "/${problem_arr}/,/${problem_arr}/p" problemid.txt ---some operation goes... (11 Replies)
Discussion started by: InduInduIndu
11 Replies
petcat(1)						      C64 Program Development							 petcat(1)

NAME
petcat - convert and display PETSCII or BASIC files SYNOPSIS
petcat [ -text | -<version> | -w<version> | -k<version> ] [ -l hexaddr ] [ -c | -nc ] [ -o outfile ] [ -skip offset ] [ -- ] [ file list ] DESCRIPTION
petcat converts input files from the most common CBM file formats into printable ASCII form and writes to standard output. The type of input file is determined automatically, if possible, and appropriate conversion is performed. Since a few of the BASIC versions have key- words defined differently, the right conversion has to be selected on the command line. Where such confusion cannot happen, automatical recognition of input is used. This is useful when expanding several files at once or if the program contains code for several versions, selected according to the hardware; eg. Simon's Basic vs. Basic 7.0. Please note that each input file is converted individually, but the output is produced as continuous flow. Also, all input files that are read trough a pipe, are concatenated before they reach petcat so any machine language section in between the BASIC programs causes all con- secutive files to be taken as one machine language program. For that reason files containing machine language parts attached to them must be input separately, otherwise the remaining files won't be expanded. petcat recognizes normal PETSCII text files (SEQ), program files containing directory listing, and BASIC programs. Both the original CBM files and files with a PC64 `P00' header are accepted. The differ- ent BASIC versions are not automatically distinquished, but standard C64 and C128 versions are used as default. In order to tokenize a text file into a BASIC binary file the desired BASIC version must be exclusively specified so that correct set of keywords will be used. If line numbers are not found in the beginning of each program line, the cruncher creates the missing line numbers by adding 2 to the numeric value of previous one. Since also line numbers deviating from strictly ascendind order are accepted, care must be taken when editing such a program on a C64 again. Clarification Since CBM programs usually contain unprintable characters, a way to spesify them has been created. Normally, petcat uses the same codes as most printers, but for tokenizing programs scanned from magazines, it can use the following convention: <DOWN> stands for single control code <6 RIGHT> contains amout of consecutive codes List of valid mnemonics: <wht> <dish> <ensh> <swlc> <down> <rvon> <home> <del> <esc> <red> <rght> <grn> <blu> <orng> <F1> <F3> <F5> <F7> <F2> <F4> <F6> <F8> <sret> <swuc> <blk> <up> <rvof> <clr> <inst> <brn> <lred> <gry1> <gry2> <lgrn> <lblu> <gry3> <pur> <left> <yel> <cyn> List of alternate mnemonics: <wht> <up/lo lock on> <up/lo lock off> <return> <lower case> <down> <rvs on> <home> <delete> <esc> <red> <right> <grn> <blu> <orange> <f1> <f3> <f5> <f7> <f2> <f4> <f6> <f8> <shift return> <upper case> <blk> <up> <rvs off> <clr> <insert> <brown> <lt red> <grey1> <grey2> <lt green> <lt blue> <grey3> <pur> <left> <yel> <cyn> OPTIONS
-a load_address Specify load_address for tokenized program. -c Causes petcat to interpret also control characters. By default, these strings are the same as used by printers. However, an alter- nate set is attempted whenever none within the primary set matches. Default is ON, unless text mode is selected. -nc Suppress control codes. -f Force overwrite of existing output file. Default true. -h Print filename and start address for each Basic file expanded. Default true. -nh Suppress file header in printout. -o file Redirect output to the specified file. This option overrules -h. When file has extension `.P00' and also -w option is specified, the PC64 file header is written automatically. .P00 file cannot be written on stdout but to a file only. -skip offset Skip offset bytes in the beginning of input file. -text Force text mode even if the input file looks like a Basic program, i.e. the first byte in file is 01. -k<version> Just prints all valid keywords for the specified Basic version. Without any version, all names of supported BASIC versions are listed instead. -w<version> Tokenise program listing using keywords set from the specified Basic version. -<version> Changes the set of keywords for the specified Basic version and expands tokenized input file. Without this option petcat uses V7.0 keywords in expanding. Versions 1 Basic 1.0 2 Basic 2.0 a Basic 2.0 with AtBasic t Basic 2.0 with Turtle Basic super su se Basic 2.0 with Super Expander simon si Basic 2.0 and Simon's Basic speech sp Basic 2.0 with Speech Basic v2.7 4 Basic 4.0 4e Basic 4.0 Extension 3 Basic 3.5 7 Basic 7.0 10 Basic 10.0 RESTRICTIONS
Line numbers must be less than 65536. Maximum line length is 255 bytes. Leading white space is ignored. Blank lines and line numbers not followed by any text are rejected. While expanding, Machine Language section concatenated to a BASIC program is ignored. While crunching, control codes that appear outside quotes are not interpreted. The low order byte of load address must be "01". SEE ALSO
cat(1), tr(1), sed(1), fvcbm(1), petlp(1), cbmconvert, iso2asc(1), ASCII(7), CBM Tokens Documentation, CBM's Programmers' Reference Guide series AUTHOR
Jouko Valta (jopi@stekt.oulu.fi) Thanks to Frederik Ekman (d91fe@lelle.pt.hk-r.se) Marko Makela (msmakela@nic.funet.fi) Russell Alphey (r.alphey@dce.vic.gov.au) Andre Fachat (a.fachat@physik.tu-chemnitz.de) Onno Ebbinge (ebbin200@hio.tem.NHL.NL) Frank Kontros (jeno@kontr.uzhgorod.ua) VICE
12 Dec 1996 petcat(1)

Featured Tech Videos

All times are GMT -4. The time now is 08:49 PM.
Unix & Linux Forums Content Copyright 1993-2021. All Rights Reserved.
Privacy Policy