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