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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

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

    Need direction, moving data from inside file to a separate file

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

    Need direction, moving data from inside file to a separate file

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

    Need direction, moving data from inside file to a separate file

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

    Need direction, moving data from inside file to a separate file

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

    date manipulation and filename

    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

Part and Inventory Search

Back
Top