Solved

Help With Pasting or Assigning Data in Database

Posted on 2011-09-11
8
248 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 21

Accepted Solution

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

See attached database
 import-csv.accdb
0
 

Author Comment

by:JackJackson54
Comment Utility
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
Comment Utility
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
Comment Utility
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

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

771 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

10 Experts available now in Live!

Get 1:1 Help Now