View previous topic :: View next topic
|
Author |
Message |
subramsa
New User
Joined: 15 Apr 2005 Posts: 16 Location: Bangalore, India
|
|
|
|
Hi,
I have PS file in which fields are separated by spaces like below
AAAA BBBB CCCC DDDD EEEE
AAAA BBBB CCCC DDDD EEEE
AAAA BBBB CCCC DDDD EEEE
AAAA BBBB CCCC DDDD EEEE
AAAA BBBB CCCC DDDD EEEE
My requirement is, i need to CUT CCCC field and place it next to DDDD,
so that my PS file will look like
AAAA BBBB DDDD CCCC EEEE
AAAA BBBB DDDD CCCC EEEE
AAAA BBBB DDDD CCCC EEEE
AAAA BBBB DDDD CCCC EEEE
AAAA BBBB DDDD CCCC EEEE
Is there any way i can do this in ISPF using CUT / PASTE command.
Many thanks for your help
With Regards
Saikrishnan.S
|
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
subramsa,
Generally in your Emulator itself you will be having options to cut in BLOCK MODE.
Check out Copy Mode & Cut Mode options in your emulator tools.
Regards,
Priyesh. |
|
Back to top |
|
|
subramsa
New User
Joined: 15 Apr 2005 Posts: 16 Location: Bangalore, India
|
|
|
|
Hi Priyesh.
Emulator doesn't help, becos if the length of the file is > 80, then its very difficult to align the fields after the CUT /PASTE (using Emulator method).
I would like to know any BOND command or LINE command in ISPF which can perform this operation.
Many thanks
subramsa |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi Sai,
You didn't mention the size of your file. If it's not too big, I've used this approach on many occasions:
At the end of your orig file add a line of "*", giving:
Code: |
AAAA BBBB CCCC DDDD EEEE
AAAA BBBB CCCC DDDD EEEE
AAAA BBBB CCCC DDDD EEEE
AAAA BBBB CCCC DDDD EEEE
AAAA BBBB CCCC DDDD EEEE
**************************
|
Copy the orig file after the "*" line, giving:
Code: |
AAAA BBBB CCCC DDDD EEEE
AAAA BBBB CCCC DDDD EEEE
AAAA BBBB CCCC DDDD EEEE
AAAA BBBB CCCC DDDD EEEE
AAAA BBBB CCCC DDDD EEEE
**************************
AAAA BBBB CCCC DDDD EEEE
AAAA BBBB CCCC DDDD EEEE
AAAA BBBB CCCC DDDD EEEE
AAAA BBBB CCCC DDDD EEEE
AAAA BBBB CCCC DDDD EEEE
|
Enter .a on the 1st line of the dupe copy of file; .b on the last line
On the cmd line enter c all .a .b p'=' '' 10 14. The '' are 2 single quotes w/no space between them. That yields:
Code: |
AAAA BBBB CCCC DDDD EEEE
AAAA BBBB CCCC DDDD EEEE
AAAA BBBB CCCC DDDD EEEE
AAAA BBBB CCCC DDDD EEEE
AAAA BBBB CCCC DDDD EEEE
**************************
AAAA BBBB DDDD EEEE
AAAA BBBB DDDD EEEE
AAAA BBBB DDDD EEEE
AAAA BBBB DDDD EEEE
AAAA BBBB DDDD EEEE
|
On the cmd line enter: bnd 16 xxx (xxx = lrecl of your file)
On the 1st line of the dupe copy of the file enter ))5 on the last line )). That yields:
Code: |
AAAA BBBB CCCC DDDD EEEE
AAAA BBBB CCCC DDDD EEEE
AAAA BBBB CCCC DDDD EEEE
AAAA BBBB CCCC DDDD EEEE
AAAA BBBB CCCC DDDD EEEE
**************************
AAAA BBBB DDDD EEEE
AAAA BBBB DDDD EEEE
AAAA BBBB DDDD EEEE
AAAA BBBB DDDD EEEE
AAAA BBBB DDDD EEEE
|
On the cmd line enter: bnd 1 24
On the 1st line of the orig copy of the file enter ))5 on the last line )). That yields:
Code: |
AAAA BBBB CCCC DDDD
AAAA BBBB CCCC DDDD
AAAA BBBB CCCC DDDD
AAAA BBBB CCCC DDDD
AAAA BBBB CCCC DDDD
**************************
AAAA BBBB DDDD EEEE
AAAA BBBB DDDD EEEE
AAAA BBBB DDDD EEEE
AAAA BBBB DDDD EEEE
AAAA BBBB DDDD EEEE
|
Enter cc on the 1st line of the orig copy of file; cc on the last line
Enter oo on the 1st line of the dupe copy of file; oo on the last line. That yields:
Code: |
AAAA BBBB CCCC DDDD
AAAA BBBB CCCC DDDD
AAAA BBBB CCCC DDDD
AAAA BBBB CCCC DDDD
AAAA BBBB CCCC DDDD
**************************
AAAA BBBB DDDD CCCC EEEE
AAAA BBBB DDDD CCCC EEEE
AAAA BBBB DDDD CCCC EEEE
AAAA BBBB DDDD CCCC EEEE
AAAA BBBB DDDD CCCC EEEE
|
Delete the orig file and the "*" line. That yields:
Code: |
AAAA BBBB DDDD CCCC EEEE
AAAA BBBB DDDD CCCC EEEE
AAAA BBBB DDDD CCCC EEEE
AAAA BBBB DDDD CCCC EEEE
AAAA BBBB DDDD CCCC EEEE
|
Simple, huh? There may be other ways to skin this particular cat, but the approach seems sound, ... unless I typoed something or other.
Oh! Did I mention you should save the orig file before you start this? |
|
Back to top |
|
|
subramsa
New User
Joined: 15 Apr 2005 Posts: 16 Location: Bangalore, India
|
|
|
|
Hi Jack ...
Many Many thanks for you help. Will check and get back.
Regards
Sai |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
HEY Sai,
You said you'd get back to us. It's been almost 2 wks now.
WHAZZUP? |
|
Back to top |
|
|
philepeo
New User
Joined: 18 Nov 2005 Posts: 4
|
|
|
|
you could also try on the command line doing - c 'cccc dddd' 'dddd cccc' all |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi Philepeo,
The AAAA etc. is generic. It can be QMFX or M234 or #@?% or whatever. |
|
Back to top |
|
|
|