Hello everyone... please help if you can -- I'm stumped. Making this work will save me hours of manual labor:
I need to search file2 for pattern in file1. If pattern found append file2 line to file3. If pattern not found append a blank line to file3.
file1 contents example:
123
456
789... (6 Replies)
Hey gang,
I have:
XXZZXXZZXX 123 asdaffggh dfghyrgr ertyhdhh XXZZXXZZXX 234 sdg XXZZXXZZXX 456 gfg fggfd
That is all on one line. Very simply put I want to do is something like:
sed s'/XXZZXXZZXX /\n/g'
or
tr 'XXZZXXZZXX ' '/n'
I have tried various things but can never get the desired... (6 Replies)
Hi, guys. I have one question:
How can I search for a line with certain string in it and then insert a string into this line?
For example:
There is a file called shadow, the contents of it are below:
**************************
...
yuanz:VIRADxMsadfDF/Q:0:0:50:7:::... (9 Replies)
Hi all,
I've googling around forum regarding my prob, the nearest would same as thread tittled Insert blank line if grep not found, but she/he did not mention the solution, so I would like to request your help
I've this task, to search in file2 based on pattern in file1 and output it to... (4 Replies)
Hi,
I am trying to put together a Korn Shell script to insert at a specific line.
The system we use is SunOS 5.10
I can get the line number by using:-
num=`sed -n '/export ENV/=' ./tmp.file`
Not getting much headway using the above variable's value to insert -
export SYBASE=/opt/sybase15... (5 Replies)
Hi all,
can some one help me out
file 1 i have
06/01 3:14 d378299
06/01 8:10 d642036
06/01 10:51 d600441
06/01 10:52 d600441
06/01 11:11 d607339
06/01 11:49 d398706
something like this and in file named list i have ( there is space btwn 06/01 and 11:49 and d398706)
d607339... (5 Replies)
Hi,
Anyone can help me in Solaris command on how to insert a file at specific line.
I want file1.sql content to be inserted on file2.sh after "recover database using backup controlfile until cancel".
# file1.sql
/archivelogs/927_822338133.arc
/archivelogs/671_822338107.arc... (3 Replies)
Hi All
I'm trying to insert a new line at the before each comment line in a file.
Comment lines start with '#-----'
there are other comments with in lines but I don't want a new line there.
Example file:
blah
blah #do not insert here
#this is a comment
blah #some more
#another comment... (10 Replies)
Hi All,
I am trying to write a shell script where it should insert character 'I' in 180th position of each line(except first and last line) of the file. Below is the script
for file in /home/test/bharat/*.RET
do
# Process file
echo "File Name=" $file
#l_fileName="${file##*/}"
... (19 Replies)
Hi,
I'm trying to add a new line after finding a specific String.
That is my string:
volumes:
- ${DIR_WORK}/loadbalancer/html:/var/www/html
and I want to change that file to:
volumes:
- ${DIR_WORK}/loadbalancer/html:/var/www/html
extra_hosts:
-... (4 Replies)
Discussion started by: siamak
4 Replies
LEARN ABOUT SUSE
igawk
IGAWK(1) Utility Commands IGAWK(1)NAME
igawk - gawk with include files
SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ...
igawk [ all gawk options ] [ -- ] program-text file ...
DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1).
AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like
@include getopt.awk
in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path.
OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports.
EXAMPLES
cat << EOF > test.awk
@include getopt.awk
BEGIN {
while (getopt(ARGC, ARGV, "am:q") != -1)
...
}
EOF
igawk -f test.awk
SEE ALSO gawk(1)
Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995.
AUTHOR
Arnold Robbins (arnold@skeeve.com).
Free Software Foundation Nov 3 1999 IGAWK(1)