Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- awk 'BEGIN {count = 1
- print "INSERT INTO ofRoster(ROSTERID, USERNAME, JID, SUB, ASK, RECV, NICK) VALUES (\47 1\47, \47test\47,\47test@test.com\47,\47 3\47,\47 -1\47, \47-1\47, \47 "
- }
- {
- if($0 ~ /@/ ) {
- count = count + 1
- print"\47), (\47",count,"\47, \47",substr(FILENAME,1,length(FILENAME)-4), "\47,\47 ", substr($1, 3, length($1)-4), "\47,\47 3\47,\47 -1\47, \47-1\47, \47"
- }
- if($0 ~ /name/) {
- if(NF==4)
- print substr($3,2, length($3)), substr($4, 1, length($4)-2)
- else if(NF==5)
- print substr($3,2, length($3)), $4, substr($5, 1, length($5)-2)
- }
- }
- END {print "\47);"} '
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement