Find the answer to your Linux question:
Results 1 to 3 of 3
Using this section of code: Code: lynx -source wwwdotwebsitedotcom > file1.txt tr '\r' '\n' <file1.txt > file2.txt I end up with the opposite of what I need: file1 gets the ...
  1. #1
    Just Joined!
    Join Date
    Jan 2011
    Posts
    4

    Lynx -source, change from Mac to UNIX

    Using this section of code:
    Code:
    lynx -source wwwdotwebsitedotcom > file1.txt tr '\r' '\n' <file1.txt > file2.txt
    I end up with the opposite of what I need:

    file1 gets the UNIX formatting but is blank
    file2 gets the text but still has the Mac formatting

    The goal is to get file1.txt that is scraped in Mac format to end up output as file2.txt in UNIX format to be grepped later, but only run this one command.

    Putting a pipe between "file1.txt | tr '\r' etc.." only makes it worse.

    Probably some idiotically simple solution but I guess I gotta start somewhere and all my mutated efforts give me mutated results.

    Thanks for any ideas.

  2. #2
    Linux Enthusiast Mudgen's Avatar
    Join Date
    Feb 2007
    Location
    Virginia
    Posts
    623
    You probably want something like:
    lynx -source wwwdotwebsitedotcom > file1.txt;cat file1.txt| tr '\r' '\n' > file2.txt

    Or just:
    lynx -source wwwdotwebsitedotcom | tr '\r' '\n' > file2.txt
    if you don't need file1 as a remainder.
    Last edited by Mudgen; 01-30-2011 at 02:37 AM. Reason: add

  3. #3
    Just Joined!
    Join Date
    Jan 2011
    Posts
    4
    Thank you very much greyhairweenie.
    That was exactly what I was trying for.
    I must have tried every combination but that one.
    Thanks.

Posting Permissions

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