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

    print and append!!

    HI group, im trying to do the following: print a statement "im learning unix" append the contents of a file print another line at the end. ---all into one single file. expected output: im learing unix --- contents from a file-------- 1 2 3 4 ------conetnts from the line ends-- lastline " >...
  2. joeroe3380

    Appending trailing commas!

    Hi chacalinc, The awk concatenates all the lines and doesnt restore the spaces between. say Select actb_cd pair() , actv_df_pair , is converted to Selectactb_cd pair(),actv_df_pair, Thanks roe
  3. joeroe3380

    Appending trailing commas!

    HI gurus! I have a input file as follows: nvl(BIN_NBR, ' ') , ACTN_CD , nvl(NBR, ' ') , DC_ACTN_CD , SORT_ID ...
  4. joeroe3380

    substitution error

    i put the control character for pattern matching and whew!! finally its working. Thanks again !! roe
  5. joeroe3380

    substitution error

    your are right, after vi :set list i see the control characters as || 'ú' ||$. Please let me know how to delet this?? Thank you all for your time and help!! roe
  6. joeroe3380

    substitution error

    thats right there isnt any back ticks!!
  7. joeroe3380

    substitution error

    nope, i still have the same output. 'M-G' seems to be strange!!!
  8. joeroe3380

    substitution error

    I tried that too still the same. However the || gets deleted fine, except for the 'M-G' in || 'M-G' ||. Thanks a lot again roe
  9. joeroe3380

    substitution error

    i rechecked the sed that i executed : its "ditto" as the one you sent. but still the same output as before. Im on HP-UX. Appreciate your time and help! Thanks roe
  10. joeroe3380

    substitution error

    input file record: nvl(MP_MID_INIT_TXT, ' ') || 'M-G' || lpad(nvl(MP_SEQ_IMS_ID, 0), 3, 0) || lpad(nvl(MP_IMS_ID, 0), 7, 0) || 'M-G' || desired output: nvl(MP_MID_INIT_TXT, ' ')...
  11. joeroe3380

    substitution error

    I have the following numerous line in input file: nvl(MP_MID_INIT_TXT, ' ') || 'M-G' || lpad(nvl(MP_SEQ_IMS_ID, 0), 3, 0) || lpad(nvl(MP_IMS_ID, 0), 7, 0) || 'M-G' || from which i need to delete the || 'M-G' || and ||...
  12. joeroe3380

    SED ERROR

    i have the sed statement to change to_char(BASE_DT, 'YYDDD')to to_char(CYC_DT, 'YYDDD')BASE_DT. The sed that i have is : sed 's/to_char\(BASE_DT, \'YYDDD\'\)/to_char\(CYC_DT, \'YYDDD\'\) BASE_DT/g' outdat.sql > osql.sql However this gives an error. Please advice on the right syntax. Thanks a...
  13. joeroe3380

    SED script - modification

    futurlet, The modified awk worked fine for the sub( /B\./, "" ), but the sub( /\(B\.In_DT,'YYDD'\)/, "(OT_DT,'YYDDD')In_DT" ) doesnt still substitute for the desired one. I have oin the first line : select to_char(A.BASE_DT, 'YYDDD') || 'M-G' || which needs to be changed to...
  14. joeroe3380

    SED script - modification

    Futurlet, Thanks alot for the superb script. Though the above awk does most of the tasks required, it however doesnt change the occurance of B. to " " as required. Also i need to replace the occurance of '(B.In_DT,'YYDD')' to '(OT_DT,'YYDDD')In_DT'. Please advice on modifying the awk for the...
  15. joeroe3380

    SED script

    Futurlet, Thanks alot for the superb script. Though the above awk does most of the tasks required, it however doesnt change the occurance of B. to " " as required. Also i need to replace the occurance of '(B.In_DT,'YYDD')' to '(OT_DT,'YYDDD')In_DT'. Please advice on modifying the awk for the...
  16. joeroe3380

    SED script

    Hi group, i was trying to accomplish the following; read file1 untill the line "B_comb" is encountered and not including the phrase "B_comb".(say line 181 has sql_seq_num B_comb; B_comb should be removed while reading all the lines upto "B_comb" and retainig 'sql_seq_num' but removing...
  17. joeroe3380

    SED statement

    Hi group, ( sed '$d' infile1 ; sed '1d'infile2 ; sed -n '$p'infile2) > outfile.dat I tried the above script to concatenate 2 files stripping the last line of first file, appending the second file after stripping the first line of second line. In the process as the last line of the second file...
  18. joeroe3380

    concat two files

    Thanks vgersh99, However, it strips the last line of the second file too which is not desireable. I believe sed executes the commands line by line to each of the streams. can the sed be modified so as to strip the first line of the second file only and retain the last line? Thanks for your help roe
  19. joeroe3380

    concat two files

    PHV, Thanks alot for the powerful script. That certainly did the job efficiently. However, i need to also, strip the first line from the second file before appending it. I tried manipulating the code that you had sent before but couldnt get it right: (sed '$d' infile1; cat | sed '1d' infile2) >...
  20. joeroe3380

    concat two files

    Hi Group, I need to concatenate two files; read in the first file to a new file delete the last line from the new file. append the second file to this new file stripped of last line from the first file. I tried working arround with two cat command and tail-n1 /dev/null 2>&1 to strip off the...

Part and Inventory Search

Back
Top