Feb 27, 2007 #1 Yarka Technical User Jan 14, 2007 192 ES Hi, How can I delete the last position of the a column efficiently? For example, if my input is: 12350 a 2361 bc 655594 h ... my output should be as: 1235 a 236 bc 65559 h Thanks.
Hi, How can I delete the last position of the a column efficiently? For example, if my input is: 12350 a 2361 bc 655594 h ... my output should be as: 1235 a 236 bc 65559 h Thanks.
Feb 27, 2007 1 #2 PHV MIS Nov 8, 2002 53,708 FR sed 's!. ! !' input > output If the column separator is a tabulation, replace each space with a tab char. Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886 Upvote 0 Downvote
sed 's!. ! !' input > output If the column separator is a tabulation, replace each space with a tab char. Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
Feb 27, 2007 Thread starter #3 Yarka Technical User Jan 14, 2007 192 ES Hi, My sed command, don't have option s. When I execute sed 's!. ! !' input > output, I've: sed: -e expression #1, char 6: unknown option to `s' Thanks. Upvote 0 Downvote
Hi, My sed command, don't have option s. When I execute sed 's!. ! !' input > output, I've: sed: -e expression #1, char 6: unknown option to `s' Thanks.
Feb 27, 2007 #4 PHV MIS Nov 8, 2002 53,708 FR Which flavor of *nix ? What about this ? sed 's/. / /' input > output Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886 Upvote 0 Downvote
Which flavor of *nix ? What about this ? sed 's/. / /' input > output Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
Feb 27, 2007 Thread starter #5 Yarka Technical User Jan 14, 2007 192 ES It is OK, but if I want to delete the last position of last column (the last column didn't have space or tab). How can I delete it in this situation? Thanks. Upvote 0 Downvote
It is OK, but if I want to delete the last position of last column (the last column didn't have space or tab). How can I delete it in this situation? Thanks.
Feb 27, 2007 #6 PHV MIS Nov 8, 2002 53,708 FR sed 's/.$//' input > output Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886 Upvote 0 Downvote
sed 's/.$//' input > output Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
Feb 27, 2007 Thread starter #7 Yarka Technical User Jan 14, 2007 192 ES Very good, PHV. Thanks Upvote 0 Downvote