Home Messages Index
[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index

Re: harvesting addresses from kmail folders

alexd wrote:

> Roy Schestowitz wrote:
> 
>> __/ [ Whiskers ] on Sunday 05 March 2006 00:01 \__
> 
>>> I expect a more 'refined' method could be devised, but grep is the basic
>>> tool.  See man grep  ;))

>> I'd imagine that the best use of time would involve echoing or
>> concatenating all lines that contain "From: ", then remove duplicate
>> lines and manually copy them to KMail. If you add some commas in
>> accordance with the CSV conventions (if any exist), then you should be
>> able to import as CSV. I think you get to assign the column names (thus
>> meaning) when importing file that are CSV or TSV. You could use KSpread
>> to help you with that.
> 
> Thanks for the CSV tip. I nearly ended up spending the entire day doing
> something perl-y with .vcf files :-S

I've produced a monster:

grep -h "^From:\|^To:" ~/Mail/*/cur/* |grep \@|sort| uniq | tr -d ,
[\<\>\(\)\"| awk '{ print $2 " " $3 " " $4 " " $5 " "  $6 }'  | sed
'{ s/mailto:// }' | grep -v [\=\&] |  sed '{ s/[a-Z0-9_.-]\{1,\}@/,&/ }' |
uniq > ~/addressbook.csv

Tidied up the output in kspread. Had to customise kspread with a "Delete
Rows" button on the toolbar to make life easier.

-- 
 <http://ale.cx/> (AIM:troffasky) (gebssnfxl@xxxxxxxxxxx)
 15:39:38 up 38 days, 19:58,  4 users,  load average: 0.76, 0.27, 0.14
 This is my BOOOOOOOOOOOOOOOOOOOOOMSTICK


[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index