Quantcast
Channel: SQLServerCentral » Programming » Powershell » Latest topics
Viewing all articles
Browse latest Browse all 467

Parse the Data and pump it onto SQL Sever

$
0
0
Hello All,I have a requirement to pump the data from .txt file into SQL table. I was able to do this in the past. but this time i have a problem in the data format. Below is the sample of data format in text file.ID, Active, User, Client, Machine, StartTime, Duration, KernelTime, UserTime306287760, active, <unknown>, <unknown>, <unknown>, 12:07:13, 0:00:00.004, 0.000, 0.000306287758, netwait, <unknown>, <unknown>, <unknown>, 12:07:13, 0:00:00.041, 0.000, 0.000306287757, netwait, <unknown>, <unknown>, <unknown>, 12:07:13, 0:00:00.046, 0.000, 0.000306287755, netwait, <unknown>, <unknown>, <unknown>, 12:07:13, 0:00:00.050, 0.000, 0.000306287753, authwait, <unknown>, <unknown>, <unknown>, 12:07:13, 0:00:00.054, 0.000, 0.015306287752, netwait, <unknown>, <unknown>, <unknown>, 12:07:13, 0:00:00.085, 0.000, 0.000306287751, netwait, <unknown>, <unknown>, <unknown>, 12:07:13, 0:00:00.121, 0.000, 0.000306287746, authwait, <unknown>, <unknown>, <unknown>, 12:07:13, 0:00:00.126, 0.000, 0.000As you can see, the data is delimited by , it has 9 columns in this data format. I just need to pump the above data in SQL table using powershell. (I know how to pump the data into SQL from powershell. I need help to parse the above data which delimited by ,)

Viewing all articles
Browse latest Browse all 467

Trending Articles