Hi,
How can we replace space character with new line character in UNIX based file?
For example, if "Dsxchange is helpful" is coming in a single column, I want the ouput in a Sequential File to be in the below format:
Dsxchange
is
helpful
Thanks in advance.
Deepa
Replace space character with new line character in UNIX file
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 95
- Joined: Thu Sep 24, 2009 12:15 am
- Location: India
-
- Premium Member
- Posts: 232
- Joined: Fri Aug 04, 2006 1:20 am
- Location: Bangalore
Just replace the space with Char(10), you will get your required output.
I didnt test this code, please do the required changes.
Code: Select all
Ereplace(MyString, " ", Char(10))
Or
Convert(' ',char(10),MyString)
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
Even though Convert and EReplace may work, it will result in damaging the record as the target is a sequential file.
If you see the full picture, it will be something like
If you see the full picture, it will be something like
intocolumn1, column2, column3,...,Dsxchange is helpful,....,columnN
which may not make any sensecolumn1, column2, column3,...,Dsxchange
is
helpful,....,columnN