Removing carrige return in a specific position 
Author Message
 Removing carrige return in a specific position

 a have a big problem!!!

 I would like to remove the end and carridge return of lines in file wich
 containts for exemple this character {4 the records are separated by
 RS="$" and each record must be printed in 600 characters long in the
output
 file

 Could anyone tell me how to do this in ???thanks a lot
 Nbella

 ex:
 A{ffgghjjjkkklk}{ffkfkffkfkfk}{4jhjhhj  \n (\012 and \015)
 (dhdhdhdhd) \n
 {jdsjdjdjdjdj }$M{vgfjflkjflkkflkfkf}{4fkfdkfk \n




Wed, 18 Apr 2001 03:00:00 GMT  
 Removing carrige return in a specific position

Quote:

>  a have a big problem!!!

>  I would like to remove the end and carridge return of lines in file wich
>  containts for exemple this character {4 the records are separated by
>  RS="$" and each record must be printed in 600 characters long in the
> output
>  file

>  Could anyone tell me how to do this in ???thanks a lot
>  Nbella

>  ex:
>  A{ffgghjjjkkklk}{ffkfkffkfkfk}{4jhjhhj  \n (\012 and \015)
>  (dhdhdhdhd) \n
>  {jdsjdjdjdjdj }$M{vgfjflkjflkkflkfkf}{4fkfdkfk \n



BEGIN {
RS="$"}
/{4/ {gsub("\n","");printf "%-600s\n", $0}

I'm not sure if this is what you intended but the output from your
sample file gave two lines each 600 characters long padded with spaces
on the right and starting with:

A{ffgghjjjkkklk}{ffkfkffkfkfk}{4jhjhhj(dhdhdhdhd){jdsjdjdjdjdj }
M{vgfjflkjflkkflkfkf}{4fkfdkfk

Is this what you wanted?

Cesar
--
Please remove the uppercase characters from my e-mail address for the
real thing



Wed, 18 Apr 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Removing End of Line and carrige return

2. Carrige return Problem where did I go wrong

3. How to add a Carrige Return to a memo File

4. Removing a specific item from a collection?

5. Vi that returns the reference of a specific control

6. How to return # files in specific dir

7. RETURN to a specific point

8. counting specific records w POINTER() or POSITION()

9. Display data in list from a specific position in a queue

10. Opening VRML worlds at specific camera position...

11. replace value of a specific position

12. Scrolling a text widget to a specific position

 

 
Powered by phpBB® Forum Software