20071126

Convert a tab delimited file to CSV format using Regular Expressions in vi substitution.

Open the tab delimited file with vi.

a) At the end of each line delete all the whitespaces (one or more):

:1,$s/\s\+$//g

b) Substitute all the whitespaces (one or more) with comma ',' :

:1,$s/\s\+/,/g

Δεν υπάρχουν σχόλια:

eggs.in.art (my non-technical blog)