Here is the results of sed command on file
$ echo $var4
lendennissri
$ sed '/THR/{x;s/^/$var4/;G;}' $file > $file.new
FNR 0 0 20030227081712 out
$var4
THR 0 0 ST M
is there any other syntax I am not using ???
thanks for the help
Len
Hauter
I have tried your code exactly with the apostrophe after the /THR/ and without and I get no results
Is there any other syntax that I need to use ???
example
$ perl -i.tmp -p -e print '$var4\n' if /THR/' $file.tmp
I even tried different entries another example with results
$ perl...
I have inserted text in a line with no problem
but i am lost when trying to put a variable example (A$) in a line of a file
example
perl -i.tmp -p -e 'print "$A$\n" if /THR/' $file.tmp
the line show up blank but inserted before THR
the variable is loaded right before this line of...
I have a file where I am reading through directories then files. I read each line and find a match = THR
I want to insert a line before only this in the file.
I have tried different perl commands -i but only get blank lines to appear.
thanks, for any assistance
Len Turnbull
I am using a current FTP script and trying to attach a generic script to send to multiple locations based on flags and counters. I want to add it at the time that FTPing takes place but I am getting an error.
I am not sure I am setting up the 2nd script properly.
Example
:ftpscript
>$FTPLOG...
This works if I am printing to the screen.
Example
var1=RECKFTP204 and print shows RECKFTP204 if I
echo "var1 > [$var1]"
it shows the [RECKFTP204 ]
but when I pass it to the line in the file it only shows
RECKFTP204 (one space) and no padding.
Am I doing something wrong or do I...
vgersh99,
I keep getting the diplay with the "[" at each end.
Am I being to literate in following the setup of variables.
I want to be to utlize this information and put it in a work file as a variable.
Thanks for the quick response
Len
I am trying to build one variable from information gathered in a script.
example:
var1=abcdedfg
need to pad this to 15 characters
var2=file name
need to pad this to 256 characters
var3="set id" (3chars always)
var1 and var2 can change all the time
I want to be able to...
I am attempting to collect data and format one variable.
I have SYS + var1 (could be up to 15char) + var2 (could be up to 256char).
The var2 is a file name and can have from 1 to 256 chars.
I am putting this scenario together and inserting it at the beggining of each line to pass to another...
Vgersh99, yes you answered last week.
I got the file to split with the script you sent.
So when you say the current processing file is refered by the internal variable FILENAME. Can I pass it into the awk -f line to have it be the file name that is generated by the awk script ????
Am I clear...
I am using this in a RS6000 Aix environment.
The application id is splitxxx.awk
One other thing I have a question on
since I pass the file into this script.
Is the file name available to use when the line
print > outfile is in play ???
I wonder if I need to set a filename var in the Begin ...
I am splitting information inside a script and want to establish a file name from data read. Right now I have a script that separates and fills a file but the file name is one I create. In the file I am reading the 2nd text line(record) has the 9th field that I want to id the file.
I am...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.