conversion of usb usage output to csv file

Microsoft Windows xp professional w/serv...
September 13, 2010 at 20:39:09
Specs: Windows XP, 512
hi...... thanks for allowing me to start a discussion

i am collecting usb usage details of all users and convert it into csv files so that i can export it into some database..

the input text file is as follows:-

USB History Dump
by nabiy (c)2008

(1) --- Kingston DataTraveler 130 USB Device

instanceID: 0018F3D974B4A9C0E1760896&0
ParentIdPrefix: 7&b62e00e&2
Last Mounted As: \DosDevices\I:
Disk Stamp: 09/07/2010 15:07
Volume Stamp: 09/07/2010 15:07

(2) --- Kingston DataTraveler 2.0 USB Device

instanceID: 001D0F1E35B25B8C1201011B&0
ParentIdPrefix: 7&1f5848f3&0
Disk Stamp: 09/06/2010 15:18
Volume Stamp: 09/06/2010 15:18

(3) --- Maxtor OneTouch III USB Device

instanceID: 044303E5&0
Disk Stamp: 09/10/2010 10:09
Volume Stamp: 03/12/2010 10:42

how can i parse this file so that i can get in following format

hostname Devic_name instanceID ParentPrefix LastMountedAs Driver Disk_Stamp Volum_st
pcname kingston 001xxxx 7&b62e00e DosDevices\I 4Dxxxx 09/07/2010 09/07/2x
maxtor 0440xxx 4d 367 08/07/2010 09/89/2x

the output desirable is in csv format for database with some batch or awk script........
any suggestion in this regard is greatly appreciated
thanks in advance/.........

See More: conversion of usb usage output to csv file

Report •

September 14, 2010 at 03:22:28
hello please give some ideas to above question............

Report •

September 14, 2010 at 03:57:00
Dude, since it's a txt file it should be the same as you previous question about the firewall thingy...

Report •

September 14, 2010 at 04:11:53
thanks for suggestion///////////////////// i ll try it...........

Report •

Related Solutions

September 14, 2010 at 20:25:42
as per ur suggestion i tried with awk script....

print "Node,device_name,instanceID,ParentIdPrefix,Last Mounted As,Driver,Disk Stamp,volume_stamp"
cmd | getline hostname
printf "%s",hostname
NR>3{ s=s","$2 }
END{ print s }

but the output i got is as follows

Node,device_name,instanceID,ParentIdPrefix,Last Mounted As,Driver,Disk Stamp,volume_stamp
conf6xp,,, 0018F3D974B4A9C0E1760896&0, 7&b62e00e&2, \DosDevices\I,{4D36E967-E325-11CE-BFC1-08002BE10318}\0033, 09/07/2010 15, 09/07/2010 15,,,, 001D0F1E35B25B8C1201011B&0, 7&1f5848f3&0,{4D36E967-E325-11CE-BFC1-08002BE10318}\0035, 09/06/2010 15, 09/06/2010 15,,,, 044303E5&0,,{4D36E967-E325-11CE-BFC1-08002BE10318}\0032, 09/10/2010 10, 03/12/2010 10

it means that .... i added a new column device_name in between node and instance_id and tried to bring kingston data traveller or maxtor under it.....but could not achieve that

the second paragraph of another kingston device details had inligned with with first... as additional columns without headding.........

how to bring the second paragraph just under first one in the following manner

the desired output is
Node device_name instanceid parent_id last_mount as xxx xxxxx xxxxxxxx xxx
abc kingston 33333 2222 xxxx xx xxx xxxxxxxx
abc jetflash 44444 4444 3333 3333 222 2222

please provide some suggestions to achieve this..............

Report •

September 15, 2010 at 00:14:26
i think i messed up some where...... please help!!!!!!!

Report •

Ask Question