Find the answer to your Linux question:
Results 1 to 4 of 4
Hello I have a directory of several text files formatted as follwoing [25.8376] [32.1000] B: xab~ir $uw fiy Eindak >axbaAr [2.8376] [12.1000] B: xab $uw Gde Ginda >qwaAd [100.8376] [200.1000] ...
  1. #1
    Just Joined!
    Join Date
    May 2007
    Posts
    15

    script to get a part of line from a text file

    Hello
    I have a directory of several text files formatted as follwoing
    [25.8376] [32.1000] B: xab~ir $uw fiy Eindak >axbaAr
    [2.8376] [12.1000] B: xab $uw Gde Ginda >qwaAd
    [100.8376] [200.1000] A: xab~ir $gd fhg Qwerak AssbaAr .
    it appears that it has three parts seperated by \t tab,I want to get only the last part (red) of line and so on for whole file then all files
    putting them in one file as output file formated as a words seperated by spaces

    would you please help me to write a script to do that ??
    thanx a lot
    MD

  2. #2
    Just Joined!
    Join Date
    May 2007
    Posts
    15
    please is there someone to help in ?

  3. #3
    Linux Newbie birdman's Avatar
    Join Date
    Mar 2006
    Location
    Ireland
    Posts
    141
    You could take advantage of the fact that there is a colon followed by a space in each line directly where you want to start taking your new lines from

    Code:
    sed "s/.*: //g" textfile > outputfile
    Regards

  4. #4
    Just Joined!
    Join Date
    May 2007
    Posts
    15
    thank you Birdman it's walking

Posting Permissions

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