Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by lenjturnbull

  1. lenjturnbull

    Inserting line in a file

    Ygor, Your awk command worked perfectly.... I really appreciate the response and assistance Len
  2. lenjturnbull

    Inserting line in a file

    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
  3. lenjturnbull

    Need direction inserting variables in a line

    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...
  4. lenjturnbull

    Need direction inserting variables in a line

    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...
  5. lenjturnbull

    Inserting line in a file

    Could you explain the $0 variable ??? also are the {'s to be used or are these for editting purposes ?? Thanks, len
  6. lenjturnbull

    Inserting line in a file

    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
  7. lenjturnbull

    Setting up generic FTP multiple locations

    Sorry, Andy but I was not thinking ... While running this script I got a 127 error back from RS6000 in a log. Thanks, Len
  8. lenjturnbull

    Setting up generic FTP multiple locations

    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...
  9. lenjturnbull

    Formatting Variables

    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...
  10. lenjturnbull

    Variable formatting inquiry

    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
  11. lenjturnbull

    Variable formatting inquiry

    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...
  12. lenjturnbull

    Formatting Variables

    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...
  13. lenjturnbull

    Creating File names inside script

    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...
  14. lenjturnbull

    Creating File names inside script

    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 ...
  15. lenjturnbull

    Creating File names inside script

    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...

Part and Inventory Search

Back
Top