Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parsing or Looping Data

Status
Not open for further replies.

Phenix007

Programmer
Mar 14, 2012
1
US
I am having an issue with scrubbing some data that I am pulling in from a CSV file from a bar code scanner. I am working on a little event attendee management tool. The scanner records a Session ID and then scans the Name Badge IDs from the people coming into the class. The problem is the low end (i.e. cheap) bar code scanner basically saves only 3 items: (1) Date stamp, (2) Time stamp and (3) Bar Code.

So, what I get is data that looks like this:
3/1/2012,11:00:00,Session1
3/1/2012,11:00:00,10125
3/1/2012,11:00:00,10126

What I want is data that looks like this:

3/1/2012,11:00:00,10125,Session1
3/1/2012,11:00:00,10126,Session1

I figure I should be able to loop through the data, find a field that begins with "Session" and then assign it to a variable and add it to a new field value for the rows following...until it hits another field that begins with "Session". And I would need to delete the row with just the Session ID on it.

But I don't know how to do it!!! Argh....can anyone help?

Thanks,

Lance
 
Seems to me that you could import the data into a table and simply modify it with a query. How is the data layout in the csv file look?
do you already have a table?

HTH << MaZeWorX >> "I have not failed I have only found ten thousand ways that don't work" <<Edison>>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top