Nov 10, 2003 #1 ianicr IS-IT--Management Joined Nov 4, 2003 Messages 230 Location GB I have a csv file with names and addresses eg. Mr,Smith,1,New Street,Birmingham Is there an easy way of removing the third comma to make the file Mr,Smith,1 New Street, Birmingham Thanks
I have a csv file with names and addresses eg. Mr,Smith,1,New Street,Birmingham Is there an easy way of removing the third comma to make the file Mr,Smith,1 New Street, Birmingham Thanks
Nov 10, 2003 1 #2 Annihilannic MIS Joined Jun 22, 2000 Messages 6,317 Location AU sed 's/,/ /3' filename > output should do it (a trick I learned from SamBones). Annihilannic. Upvote 0 Downvote
Nov 10, 2003 Thread starter #3 ianicr IS-IT--Management Joined Nov 4, 2003 Messages 230 Location GB You're a star. Thanks a lot Upvote 0 Downvote
Nov 10, 2003 Thread starter #4 ianicr IS-IT--Management Joined Nov 4, 2003 Messages 230 Location GB One last thing, how do you do it with a tab delimited file? Upvote 0 Downvote
Nov 10, 2003 #5 dickiebird Programmer Joined Feb 14, 2002 Messages 758 Location GB sed 's/,/ /' infile > outfile will replace the first , found with a space, irrespective of the delimiter Dickie Bird (-))) Upvote 0 Downvote
sed 's/,/ /' infile > outfile will replace the first , found with a space, irrespective of the delimiter Dickie Bird (-)))
Nov 12, 2003 #6 PHV MIS Joined Nov 8, 2002 Messages 53,708 Location FR With a Tab delimited file: Code: sed 's/ / /3' filename > output ^^^ Single Tab char Hope This Help PH. Upvote 0 Downvote
With a Tab delimited file: Code: sed 's/ / /3' filename > output ^^^ Single Tab char Hope This Help PH.