Find the answer to your Linux question:
Results 1 to 5 of 5
Hi, I want to find a word from file where each line is of 80 characters and thats why last words on each line are continued on next line. e.g. ...
  1. #1
    Just Joined!
    Join Date
    Sep 2008
    Posts
    3

    find a word from file which is typed on two lines

    Hi,
    I want to find a word from file where each line is of 80 characters and thats why last words on each line are continued on next line.

    e.g. My file is

    Tue Sep 23 11:51:51: Submitted from host <lsfhost.localdomain>, CWD <$HOME>, Ou
    tput File <outfile>, Error File <errfile>, 8 Processors Re
    quested;

    Here if i want to get a pair as OutputFile <outputfile>

    How can i do this?

    Thanks in advance.


    Thanks & Regards
    Deepika B. Mane

  2. #2
    Linux User
    Join Date
    Aug 2006
    Posts
    458
    Code:
     tr  "\n" " " < file

  3. #3
    Just Joined!
    Join Date
    Sep 2008
    Posts
    3
    Thanks

    I have tried it. But This keeps a space betwwen a word.
    Like Ou tput File
    I want to get full word.

    this is output of tr "\n" " "
    Tue Sep 23 11:51:51: Submitted from host <lsfhost.localdomain>,
    CWD <$HOME>, Ou tput File <outfile>, Error File <errfile>, 8 Processors Re quested;

  4. #4
    Linux User
    Join Date
    Aug 2006
    Posts
    458
    try this then
    Code:
    awk '1' ORS="" file

  5. #5
    Just Joined!
    Join Date
    Sep 2008
    Posts
    3
    Hi,
    Thanks for the quick reply
    Actually i want to extract key value pairs from a file.
    How can i do it?
    This is my file:-
    Job <2797>, User <deepika>, Project <default>, Status <DONE>, Queue <normal>, C
    ommand </home/deepika/ESPRESSO/examples/example04/run_exam
    ple>
    Tue Sep 23 11:51:51: Submitted from host <lsfhost.localdomain>, CWD <$HOME>, Ou
    tput File <outfile>, Error File <errfile>, 8 Processors Re
    quested;
    Tue Sep 23 11:51:53: Started on 8 Hosts/Processors <8*lsfhost.localdomain>, Exe
    cution Home </home/deepika>, Execution CWD </home/deepika>
    ;
    Tue Sep 23 11:51:53: slurm_id=478147;ncpus=8;slurm_alloc=dctest4;
    Tue Sep 23 12:00:42: Done successfully. The CPU time used is 1698.0 seconds.



    Thanks in Advance

Posting Permissions

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