@Vryali,
Thanks a lot and the code worked fine. However, Is it possible to insert the text in a Alphabetical Order instead of inserting it in the Last line.
I have a file with
aaa,bbb,ccc,dddd,eee,xyz
aaa,bbb,ccc,dddd,eee,xyz,12345,rty
aaa,bbb,ccc,dddd,eee,xyz,12345,rty,tsrt
1. line columns are not fixed
2. all words are seperated by comma
what i want is always the string after last comma.
regards,
Senthil... (9 Replies)
Hi Friends.
Please have a look at dummy file. I need to extract from this file:
1. Counts of event=
2. the 2nd coulmn is unique call id of this transaction. Based on that, i have to search for txstatus= .
Note: Values of event, calltype and txstatus can be anything.
I want to print... (1 Reply)
hi all,
I am trying to do search on a gzip file. The file has
<pattern1>
Data..
<pattern2>
data
<pattern1>
data
<patter2>
I want to print each pattern 1 and the corrresponding pattern2. If pattern 2 fails to appear and pattern 1 appears, I do not want to print pattern1 and... (3 Replies)
Hi ,
I am having an issue with the Awk script to insert newline for a regular expression match
Having a file like this
FILE1
####################
RXOER , RXERA , RXERC , RXERD
.RXEA(RXBSN), RXERD , REXCD
input RXEGT
buffer RXETRY
#######################
Want to match the RXE... (38 Replies)
Hi,
I use sed to insert text at beginning of a file. But sed inserts a newline after my text that I do not need. For example, I want to insert "foo" at the beginning of my file:
> cat myfile
This is first line.
> sed -i '1i\foo' myfile
> cat myfile
foo
This is first line.
... (5 Replies)
I would like to print result of multiple search pattern invoked from an one liner. The code looks like this but won't work
gawk -F '{{if ($0 ~ /pattern1/) pat1=$1 && if ($0 ~ /pattern2/) pat2=$2} ; print pat1, pat2}'
Can anybody help getting the right code? (10 Replies)
Need to
1. archive all the files in a directory from the previous month into a tar/gz file, ignoring all already archived 'tar.gz' files
2. Check created .tar.gz file isnt corrupted and has all the required files in it. and then remove the original files.
I am using a function to get the... (1 Reply)
Hi,
I am trying to find a way to get sed/awk/grep to help me find a string in a log file that exists between two datestamps and then print the preceding datestamp up to the next datestamp.
Here is an example of my logfile:
+++ 2013/03/28 17:01:37.085 SIGNALING HIGH ACTIVE
Failure Response... (5 Replies)
Hi ,
I have a huge file with following records and I want to replace the last comma with ',NULL'. I try using SED but could not create a correct script .
In my opinion I need a script which can convert ,/n with ,NULL/n
1,CHANGE_MEMBER,2010-12-28 00:05:00,
2,CHANGE_MEMBER,2012-09-02... (8 Replies)
I want to bring values in the second column into single line for uniq value in the first column.
My input
jvm01, Web 2.0 Feature Pack Library
jvm01, IBM WebSphere JAX-RS
jvm01, Custom01 Shared Library
jvm02, Web 2.0 Feature Pack Library
jvm02, IBM WebSphere JAX-RS
jvm03, Web 2.0 Feature... (10 Replies)
Discussion started by: kchinnam
10 Replies
LEARN ABOUT DEBIAN
z88dk-copt
copt(1) z88 Development Kit copt(1)NAME
copt - peephole optimizer
SYSNOPIS
copt file ...
DESCRIPTION
copt is a general-purpose peephole optimizer. It reads code from its standard input and writes an improved version to its standard output.
copy reads the named files for its optimizations, which are encoded as follows:
<pattern for input line 1>
<pattern for input line 2>
...
<pattern for input line n>
=
<pattern for output line 1>
<pattern for output line 2>
...
<pattern for output line m>
<blank line>
Pattern matching uses literal string comparison, with one exception: ``%%'' matches the ``%'' character, and ``%'' followed by a digit
matches everything up to the next occurrence of the next pattern character, though all occurrences of %n must denote the same string. For
example, the pattern ``%1=%1.'' matches exactly those strings that begin with a string X, followed by a ``='' (the first), followed by a
second occurrence of X, followed by a period. In this way, the input/output pattern
mov $%1,r%2
mov *r%2,r%2
=
mov %1,r%2
commands copt to replace runs like
mov $_a,r3
mov *r3,r3
with
mov _a,r3
Note that a tab or newline can terminate a %n variable.
copt compares each run of input patterns with the current input instruction and its predecessors. If no match is found, it advances to the
next input instruction and tries again. Otherwise, it replaces the input instructions with the corresponding output patterns, pattern vari-
ables instantiated,and resumes its search with the first instruction of the replacement. copt matches input patterns in reverse order to
cascade optimizations without backing up.
BUGS
Errors in optimization files are always possible.
SEE ALSO z88dk(1), z88dk-zcc(1), z88dk-z80asm(1), z88dk-appmake(1), z88dk-copt(1).
AUTHOR
z88dk was written by Dominic Morris <dom@z88dk.org>, and others.
01 December 2009 copt(1)