Pulling data from a text file to generate a report - ms-access

Have a program in MS-Access, using VBA. I need to come up with an If statement to pull data from a text file. The data is a list of procedures and prices. I have to pull the prices from the text file to show in a report how much each procedure costs.
ID PID M1 M2 M3 Total
1 11120390(procedure)
2 180(price) 360 180 540 1080(total Price)
3 2 1 3 6(Units sold)
4
5 200(Price) 200 600 800 1600(total price)
6 1 3 4 8(Units Sold)
7 11120390(procedure)
The table in the text file is setup like this and I need to Pull the procedure number and the price of each procedure from the text file.

This is a general answer to a vaguely-presented question. You typically have to go through these steps:
Make a connection to the file
Open the file
Parse the file (as Simon was
saying): go through it as a series
of strings, find an orientation
point, get to the relevant parts
Import the relevant parts, perhaps
in a holding table
Present the data in typical Access
fashion (query, report)
And if the file isn't well structured or correctly generated, you'll need extra parsing code and perhaps error handling to deal with aberrations.

Related

how can we create a block size in jmeter with csv config? Each thread should pickup specific set of values

how can we create a block size in JMeter with CSV config?
I have 5 multiple users and one Bulkuser.csv file with 4 columns,
The file has around 2000 values.
I wish to create a block of 400 values for my 5threads[users].
1st USER WILL USE 1st – 400 VALUES (Values in ROW 1-400)
2nd USER WILL USE NEXT 5 VALUES (Values in ROW 401-800)
and so on..
How can we implement this? is there a beanshell pre-processor script for each data read and decide to read the specific file as per thread number?
As of JMeter 5.3 this functionality is not supported, the only stable option I can think of is splitting your Bulkuser.csv into 5 separate files like user1.csv, user2.csv, etc. and use __threadNum() and __CSVRead() functions combination for accessing the data like:
${__CSVRead(user${__threadNum}.csv,0)} - reads the value from column 1 from user1.csv file for 1st thread (for 2nd thread it will be user2.csv file, etc)
${__CSVRead(user${__threadNum}.csv,1)} - reads the value from column 2
.....
${__CSVRead(user${__threadNum}.csv,next)} - proceeds to the next row
More information: How to Pick Different CSV Files at JMeter Runtime

SSIS_Get count of rows from source and load to destination

I have two OLEDB sources such as
DB Source1= select count(*) from A
DB Source2= select count(*) from B
Now, I need to get the count of Records uploaded
DB Source1 -DB Source2
for eg,
DBSource1 = 9 ;DBSource2= 1
then record uploaded will be 9-1=8
Finally I need them to be loaded to a flat file destination with following columns
RecordsReceived ErrorRecords RecordsUploaded
9 1 8
How do I achieve this?
TIA :)
You should look into the Row Count Transformation task. This one will count your selected records that flow through it and store it in a variable you declared. You can use those variables later in your script to store them in a flat file.

Skip rows when importing CSV to PowerPivot

I frequently need to pull some CSV reports and analyze them using powerpivot. The "issue" is that the tool spits out the report like this:
Report Name Keywords (Group contains 778600, Campaign contains us-en)
Client XYZ
Scope Entire Account
Date Range 3/12/2015
Filters Campaign contains us-en; Group contains 778600; Clicks > 0; Reduced Dimension
Keyword Account Publisher Campaign Group Search Bid $ Status Destination URL
Total for all 2 keywords
Keyword Account Publisher Campaign Group Search Bid $ Status Destination URL
bla bla bla Account Name Publisher Name Campaign Name Group Name 1 Active URL
So what i always need to do is to remove the first 9 rows of the CSV prior to importing. Usually i can do this on Notepad++, but sometimes the CSV is so large that i actually can't really open it to edit. So far i'm using a program called 010 Editor, but i have only some days left of it.
Is there an easy way to skip those rows when importing?
Thanks a lot
You can use Power Query (free to download) to load data to Power Pivot. It allows you to skip the first x rows and filter out rows with blank/null values. Once you are able to get this to work once, you can copy the M code to use it on other CSVs. Or you can automate it as a function and just feed it file locations.

ssis get 3 row and all the data from 9 row

in my csv file data is like this
************* file format***************************
filename, abc
date,20141112
count,456765
id,1234
,,
,,
,,
name,address,occupation,id,customertype
sam,hjhjhjh,dr,1,s
michael,dr,2,m
tina,dr,4,s
*********************more than 30000 records in each load *************************************
i have got the file in above format and i want to take date and count from 2nd and 3rd row and than the data starts from 9th row. is it possible without script task i am not so good with scripting
can anyone plz help how t get this.
With out using a script task also it is possible to do. The flow is like...
Pull 2 DFT into your package, 1 to reformat your text file and split it to 2 separated text file. 1 for your 2nd & 3rd row and another 1 for more the 9th row. The another DFT will do your rest operation which is quite simple.
1st DFT--> Flat file source--> Row Number Transformation (You can get this new transformation from this link as per your sql version <http://microsoft-ssis.blogspot.in/p/ssis-addons.html>) -->conditional split (1-->RowNumber == 2 || RowNumber == 3,2-->RowNumber > 8)-->Put the result into 2 different flat files _1 & _2 as per your convenience naming.
Now you are ready with your required 2 flat files as source to your 2nd DFT...
*If it solves your problem, mark it as answer.

Crystal Reports XI - export shared variable string to csv truncates the string

I have two databases that store information on customer appointments:
AppointmentMaster has 1 record for each appoint:
Customer Name ApptDate ApptID
------------------------------------------------
2554 Smith,Bob 20140301 100
2468 Jones, Grace 20140301 101
2795 Roberts, Sam 20140302 102
2408 Harris, Chuck 20140305 103
AppointmentDetails holds a record for each operation performed at the appointment (sometimes none, sometimes dozens):
ApptID Operation OpDescription
------------------------------------------------
100 A10 Corrected the A10 unit.
100 IA Resolved issues with internal account.
100 C5 Brief consult with client.
101 A10C Replaced cage on A10 unit.
101 U1 Updated customer account.
103 C5 Brief consult with client.
My client needs a CSV file that contains 1 line per appointment. One of the fields in the CSV is a pipe separated listing of any and all operation codes performed at the appointment. The CSV file would look like this:
"2554", "Smith,Bob", "20140301", "A10|IA|C5|"
"2468", "Jones, Grace", "20140301", "A10C|U1|"
"2795", "Roberts, Sam", "20140302", ""
"2408", "Harris, Chuck", "20140305", "C5|"
I have a crystal report created that displays the fields correctly, however when I go to export to CSV I am seeing a file like this:
"2554", "Smith,Bob", "20140301", "C5|"
"2468", "Jones, Grace", "20140301", "U1|"
"2795", "Roberts, Sam", "20140302", ""
"2408", "Harris, Chuck", "20140305", "C5|"
Only the last Operation is getting exported into CSV even though all of them display.
If I export as PDF, Excel or Record Style the file has all of the operations. Unfortunately I need a CSV. I am trying to avoid having to do multiple reports and stitch them together with a script if possible; The client wants to be able to easily run and export this themselves on demand.
I created three formula fields to initialize, update and display a shared variable that concatenates the operations together.
My report is grouped by the ApptID and looks like this:
Group Header #1 (suppressed)
{#InitializeOperations}:
WhilePrintingRecords;
shared StringVar Operations := "";
Details (suppressed)
{#UpdateOperations}:
WhilePrintingRecords;
shared StringVar Operations := Operations + {AppointmentDetails.Operation} + "|";
Group Footer #1
{AppointmentMaster.Customer}
{AppointmentMaster.Name}
{AppointmentMaster.ApptDate}
{#DisplayOperations}:
WhilePrintingRecords;
shared StringVar Operations;
I have tried using evaluateAfter(#UpdateOperations) instead of WhilePrintingRecords on the #DisplayOperations, and have even tried removing any Evalutation Time command from it as well, but I still can't get the desired effect in the CSV file despite having it look correct on screen and every other way I have tried to export it.
Any help you can provide is appreciated.