View previous topic :: View next topic |
Author |
Message |
shekar123 Advanced
Joined: 22 Jul 2005 Posts: 528 Topics: 90 Location: Bangalore India
|
Posted: Wed Nov 02, 2005 5:00 pm Post subject: need to join lines into one line in line command |
|
|
Hai all,
I want to join both the lines into one line but without no spaces between the words .Which line command should i give to obtain my desired result ?
Code: |
000009 RAJAKUMAR
000010 REDDY
****** **************************** Bottom of Data ****************************
|
DESIRED OUTPUT
----------------
Code: |
000009 RAJAKUMARREDDY
****** **************************** Bottom of Data ****************************
|
_________________ Shekar
Grow Technically |
|
Back to top |
|
 |
SureshKumar Intermediate
Joined: 23 Jan 2003 Posts: 211 Topics: 21
|
Posted: Wed Nov 02, 2005 5:32 pm Post subject: |
|
|
shekar123,
TF will get you there, however I doubt it would remove all the spaces. Try it out. Thanks |
|
Back to top |
|
 |
shekar123 Advanced
Joined: 22 Jul 2005 Posts: 528 Topics: 90 Location: Bangalore India
|
Posted: Thu Nov 03, 2005 12:53 am Post subject: |
|
|
Hai Suresh,
This is what i have tried.I do not want spaces between the two words.Can u please tell me how can i get the desired output which i am expecting ?
Code: |
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
000009 RAJAKUMAR
000010 REDDY
****** **************************** Bottom of Data ****************************
|
Code: |
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
TF0009 RAJAKUMAR
000010 REDDY
****** **************************** Bottom of Data ****************************
|
Code: |
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
000009 RAJAKUMAR REDDY
****** **************************** Bottom of Data ****************************
|
DESIRED OUTPUT
Code: |
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
000009 RAJAKUMARREDDY
****** **************************** Bottom of Data ****************************
|
_________________ Shekar
Grow Technically |
|
Back to top |
|
 |
Dibakar Advanced

Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Thu Nov 03, 2005 5:32 am Post subject: |
|
|
I don't know how is your exact data but in this case you could do "c ' ' '' 8 80" all |
|
Back to top |
|
 |
Phantom Data Mgmt Moderator

Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
Posted: Thu Nov 03, 2005 6:06 am Post subject: |
|
|
Shekar123,
Are you trying to do this merge operation manually or do u have any rexx code to do this ? If you already using any REXX then you can probably code a simple logic to do this operation.
Thanks,
Phantom |
|
Back to top |
|
 |
Mervyn Moderator

Joined: 02 Dec 2002 Posts: 415 Topics: 6 Location: Hove, England
|
Posted: Thu Nov 03, 2005 6:14 am Post subject: |
|
|
I use a macro called SPLTJOIN, which will either split a line at the cursor position, or join two lines by inserting the content of the second line at the cursor position in the first line. It's easiest to use if you set a PF key to SPLTJOIN.
It will accomplish your requirement. Have a play with it and see if it's good enough.
Code: |
/* rexx version of spltjoin clist */
address isredit
"MACRO"
"(LINE,COL) = CURSOR"
if col = 0 then
do
zedsmsg = 'Invalid cursor position'
zedlmsg = 'The cursor must be in the data',
'area to split or join'
address ispexec "SETMSG MSG(ISRZ001)"
end
else
do
"(WIDTH) = DATA_WIDTH"
"(LAST) = LINENUM .ZLAST"
"(LBND,RBND) = BOUNDS"
"BOUNDS 1" width
"(MASK) = MASKLINE"
"MASKLINE = ' '"
"TSPLIT"
"(SIZE) = LINENUM .ZLAST"
if size = last then
if line = last then
do
zedsmsg = 'At bottom of file'
zedlmsg = 'A join has no effect',
'at the bottom of the file'
address ispexec "SETMSG MSG(ISRZ001)"
end
else
do
next = line + 1
"(CURRENT) = LINE" line
"(AFTER) = LINE" next
after = strip(after)
aftlen = length(after) + col - 1
if aftlen > width then
do
zedsmsg = 'Truncation would occur'
zedlmsg = 'JOIN would truncate the data',
'so no join is done'
address ispexec "SETMSG MSG(ISRZ001)"
end
else
do
current = substr(current,1,col-1)||after
"LINE" line " = (CURRENT)"
"DELETE" next
"CURSOR =" line col
end
end
"BOUNDS" lbnd rbnd
"MASKLINE = (MASK)"
end
|
_________________ The day you stop learning the dinosaur becomes extinct |
|
Back to top |
|
 |
shekar123 Advanced
Joined: 22 Jul 2005 Posts: 528 Topics: 90 Location: Bangalore India
|
Posted: Thu Nov 03, 2005 8:53 am Post subject: |
|
|
Mervyn,
I am not using any Rexx at all ,i just want to try any line command to accompolish my task to get the desired result.Is there any line command to remove spaces between the words in a single shot.
DESIRED OUTPUT
---------------------
Code: |
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
000009 RAJAKUMARREDDY
****** **************************** Bottom of Data ****************************
|
_________________ Shekar
Grow Technically |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Thu Nov 03, 2005 9:35 am Post subject: |
|
|
Quote: |
I am not using any Rexx at all ,i just want to try any line command to accompolish my task to get the desired result.Is there any line command to remove spaces between the words in a single shot.
|
As far as I know there is no Such line command which can do what you are asking for !
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
Phantom Data Mgmt Moderator

Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
Posted: Thu Nov 03, 2005 9:44 am Post subject: |
|
|
Shekar123,
Is this a one time activity ? I think the best way is to write a small rexx routine or customize the one given by Mervyn. Believe me, it does not take much time but not worth if this is not going to be a repeated activity.
Thanks,
Phantom |
|
Back to top |
|
 |
|
|