+ Reply to Thread
Results 1 to 2 of 2

Thread: Remove one column from the file

  1. #1
    Junior Member
    Join Date
    Jun 2012
    Posts
    28

    Remove one column from the file

    I have a file like the following:
    Code:
    Record:value1|value2|value3
    Record:value4|value5|value6
    And i would like to remove a specific columns of these , like if i removed the first columns i would get :
    Code:
    value1|value2|value3
    value4|value5|value6

  2. #2
    Junior Member
    Join Date
    Apr 2012
    Posts
    34
    You can replace the Column with a pipe like :
    Code:
    sed 's/:/|/' file.txt | cut ... | sed 's/|/:/'
    OR [Another Solution]

    you can do it just with sed without cut:
    Code:
    sed 's/:[^|]*|/:/' file.txt

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

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