![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
SED question
Hello there,
I've seen quite a few post on SED to handle newline, but I tried few things doesn't seem to work. I was able to replace any tex tto newline, however viceversa (new line on Solaris returns error message as 'SED garbled".. Code:
sed 's/\ /#/g' f2 Code:
PROD~N_PROD~kf_XXX_IHIRS_TK_REP~kf_XXX_IHIRS_TK_REP~TL:- changend decimalseparator from '.' to ',' - expanded the source-sql to all the iHIRS-Indices.~UPD PROD~N_PROD~X_GEN_PX_TKD_REP~X_GEN_PX_TKD_REP~TL: - remove the sort-option from the source-sql and inserted a sort-transaction into the mapping~UPD PROD~N_PROD~kf_X_GEN_PX_TKD_REP~kf_X_GEN_PX_TKD_REP~TL:- changend the source-sql because of performance issues~UPD Step 1 : convert \n to # or something else, so that I have one line as below Quote:
Step 2: convert #PROD~ to #PROD~\n, so the output is as below Code:
PROD~N_PROD~kf_XXX_IHIRS_TK_REP~kf_XXX_IHIRS_TK_REP~TL:- changend decimalseparator from '.' to ','#- expanded the source-sql to all the iHIRS-Indices.~UPD PROD~N_PROD~X_GEN_PX_TKD_REP~X_GEN_PX_TKD_REP~TL:#- remove the sort-option from the source-sql and inserted a sort-transaction into the mapping~UPD PROD~N_PROD~kf_X_GEN_PX_TKD_REP~kf_X_GEN_PX_TKD_REP~TL:- changend the source-sql because of #performance issues~UPD Thanks |
| Forum Sponsor | ||
|
|
|
|||
|
ah, it's an RTFM(Read The Manual First) problem
Using D the lines already read being deleted from the buffer. Thanks anyway Since 'N' is going to append only the next line,so if a line spans for more than 2 rows, will the result be similar ? |
|
|||
|
Hi fmurphy,
If a record spans to more than 2 lines then above isn't working. output is kind of garbled.I've managed to handle in my application. However, I'm curious to know if it's also feasible with sed/shell Thanks Last edited by brainyoung; 02-05-2008 at 02:30 AM. |