Solved

Help With Pasting or Assigning Data in Database

Posted on 2011-09-11
8
251 Views
Last Modified: 2012-05-12
Attached are 2 comma delimited results files (Sample) (First file are Rows 1 to 110 and the Second file are rows 111 to 206)  in of a group of 59k comma delimited results files.  In column A are 3 letters (H,R and S)  to identify each row of data.  The first is H which has in the row 2 fields that I need to assign/paste  to each row in the S Rows.  I do not need to do anything to the R rows.   I need to assign/past data from C1(SAR)  to Rows L12 to  L110  and also assign/paste data from  D1(20100901) to Rows M12 to M110.

The next file starts on Row 111 and would need to assign/paste  Data in Cell C111(SUF)  to rows L121 to L206 and assign/past  Data(20100901)  in D111 to Rows M121 to M206.

I need the above query/vba code to do this to all 59k results.
 
The result I am wanting would look like Sample 2.

H Row is always 1 row
R rows can be anywhere from 5 to 14 rows
S rows vary and could be anywhere from 45 rows to 170 rows.
Sample.csv
Sample2.csv
0
Comment
Question by:JackJackson54
  • 2
  • 2
  • 2
  • +1
8 Comments
 
LVL 39

Expert Comment

by:als315
ID: 36520947
Do you like to have results in Access table or in csv file?
How files can be sorted (how can we determine files sequence)?
0
 
LVL 45

Expert Comment

by:aikimark
ID: 36521045
This doesn't look like structured and normalized data that you would put into a database.  Maybe a spreadsheet, but not a database.  What are you trying to do with the data in a database?
0
 
LVL 21
ID: 36521277
To me it sure loots like normalized data.  

Column A is the record type. Column B has the data to link the R record to the related S records.

If imported into a normalized structure you would have three tables.

H (1) --> (many) R () -->> (many) S

This would be easy to do with VBA code in Access. I will put together a sample.




 
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 21

Accepted Solution

by:
Boyd (HiTechCoach) Trimmell, Microsoft Access MVP earned 250 total points
ID: 36521560
I create a module the has a sub for importing the file

See attached database
 import-csv.accdb
0
 

Author Comment

by:JackJackson54
ID: 36522043
All I want to do is put all the S Rows in an Access database and the result would look like Sample 2
0
 

Author Comment

by:JackJackson54
ID: 36522086
I thought if if could be put in like Sample 2, I could query out all the S rows.
0
 
LVL 39

Assisted Solution

by:als315
als315 earned 250 total points
ID: 36522094
If you take Boyd's (TheHighTechCoach) example and add this query:
 
SELECT "S" AS S, tblS.S_1, tblS.s_2, tblS.S_3, tblS.S_4, tblS.S_5, tblS.S_6, tblS.S_7, tblS.S_8, tblS.S_9, tblS.S_10, tblH.H_2, tblH.H_3
FROM (tblH INNER JOIN tblR ON tblH.HRecordID = tblR.R_HRecordID) INNER JOIN tblS ON tblR.RRecordID = tblS.S_RRecordID;

Open in new window

it will be expected result
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now