Hi,
I have to change newline characters to space since one record has multiple lines from input file
like
-----------------------
1 2 3
4 5 6
3 5
-----------------------
2 4 6
6 7 8
7 7
-------------------------
In Sequential file stage I used sed 's/\n//g' which is not working
without knowing the meaning of N, sed 'N; s/\n//g' working partially.
Or use transformer stage to merge those lines? by the way all lines are delimited by newline character, no other delimiter defined for each record.
Please advice,
Thanks,
yxie
sed for newline character replacement
Moderators: chulett, rschirm, roy
Use awk as a filter in the sequential file stage, something like...
awk '{sOut=$0;getline;sOut=sOut $0;getline;sOut=sOut $0;print sOut}'
You could change to use a loop if it's more than 3 lines per record.
awk '{sOut=$0;getline;sOut=sOut $0;getline;sOut=sOut $0;print sOut}'
You could change to use a loop if it's more than 3 lines per record.
Last edited by OddJob on Fri Aug 01, 2008 4:04 am, edited 1 time in total.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: