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...
Vlad
The script worked beautifully.
Thanks for the assistance.
I appreciate all the help I get on this forum.
Question: I am reading script pgm in 24hrs but is there anything else out there to educate me ????
Len
File has data like this
ISA*text*text*text*....
GS*text*text*....
ST*text*text*....
AK1*text*text*.....
AK9*text*text*....
SE*text*text*.......
GE*text*text*......
IEA*text*text*text*text*....
ISA*text*text*text*....
GS*text*text*....
ST*text*text*....
AK1*text*text*.....
AK9*text*text*...
Let me clarify.
text file with data line by line in patterns {a1=1st line variable length, a2=2nd line variable length and so on for many lines last line in pattern will be a(xx)=1st three charcters (abc)....
I want to be able to read through and pull these lines out into another file.
then...
I have many records in file but these records are associated with each other : example a1,a2,a3,a4,a5,a6,etc... then a1,a2,a3,a4,a5,a6,etc... then a1,a2,a3,a4,a5.... and so on. I want to be able to read through the file and move a1,a2,a3,a4,a5,a6,etc... into its own file. then read on and...
I am using AIX 4.3 and the date -d "10 minutes ago" won't work here. I normally use var=`date + format` to setup
what I need is to subtract time and apply it to variable.
Thanks,
Len
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.