Find the answer to your Linux question:
Results 1 to 7 of 7
when I do this command. perldoc perl > perlinfo gives me a file with the perldoc information. The problem is when i open it up with a windows text editor ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux User
    Join Date
    Apr 2003
    Location
    TEXAS
    Posts
    314

    formatting text


    when I do this command.

    perldoc perl > perlinfo

    gives me a file with the perldoc information.

    The problem is when i open it up with a windows text editor it has a bunch of funky characters.

    Is there a way to output this as a postscript or pdf so windows can handle it and print it.
    The computer made me do it!! Slackware and SUSE too Gig\'em WHOOOOP!!
    \"God put me on this earth to accomplish a certain amount of tasks, At the rate I\'m going I will never die.\" (I don\'t know)

  2. #2
    Linux Engineer
    Join Date
    Jan 2003
    Location
    Lebanon, pa
    Posts
    994
    I bet you didn't read through perldoc did you? There is an optoin (-t) which tells it to display text and instead of using nroff.

  3. #3
    Linux User
    Join Date
    Apr 2003
    Location
    TEXAS
    Posts
    314
    Alright thanx for that bit ill read more carefully next time. One more question.

    You have the text file is there a way to make a postscript file by using the print command.
    The computer made me do it!! Slackware and SUSE too Gig\'em WHOOOOP!!
    \"God put me on this earth to accomplish a certain amount of tasks, At the rate I\'m going I will never die.\" (I don\'t know)

  4. #4
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796
    You can always use the cut,awk and sed command in nomrla shellscripts that is powerful to cut out and reformat text.

    Regards
    Regards

    Andutt

  5. #5
    Linux User
    Join Date
    Apr 2003
    Location
    TEXAS
    Posts
    314
    Ive never used that. where can i look for a good tutorial.
    The computer made me do it!! Slackware and SUSE too Gig\'em WHOOOOP!!
    \"God put me on this earth to accomplish a certain amount of tasks, At the rate I\'m going I will never die.\" (I don\'t know)

  6. #6
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796
    Use the manpages on a terminal, with that info you will come far...

    en example: you have a file that looks like this

    Nr:Firstname:Lastname:Country
    1:Clark:Kent:Usa
    2:Lisa:Stansfield:UK

    With cut you can do like this..

    Code:
    #!/bin/sh
    
    FILE=/tmp/filename
    
    NR=`cat $FILE | cut -d ":" -f1` 
    FIRNAME=`cat $FILE | cut -d ":" -f2`
    LASTNAME=`cat $FILE | cut -d ":" -f3`
    COUNTRY=`cat $FILE | cut -d ":" -f4`
    
    echo  "Nr$NR Firstname:$FIRNAME Lastname:$LASTNAME Country:$COUNTRY"
    Regards
    Regards

    Andutt

  7. #7
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    If you want to make a PostScript file from a perldoc, try this:
    Code:
    perldoc -u perl | pod2man | groff -man -Tps
    That will give the postscript output as stdout, so if you want, you can just pipe it on to, for example, "ggv -" or "gv -" to view it directly.

    For converting ASCII to PS, try the a2ps command.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •