Extract Subset Of Data From .csv File

Oct 21, 2008

I would get the End of day bhavcopy from the exchange which is a .csv file. The first column contains the column heads like name, open price etc. and the first column. Now I have to extract the names and the corresponding column values from this list by referring to a notepad that contains the ticker names to be extracted, place in another workbook and save that file.

View 10 Replies


ADVERTISEMENT

Extract Data And File Names From File In Folder And Paste Into One Sheet?

Jan 13, 2013

The code below looks at file names in column A and then goes to a folder and opens and copies the data in range c2 -lastrow from each file and pastes the data into sheet2.

how I could add to the code so that it also inserts the file name in column c?

It would make it easier to track the data in column B.

VB:
Sub CopyFromFile()
Dim fPath As String
Dim lRow As Long

[Code].....

I have attached a sample workbook. The list of file name is in sheet 1. An example of the output is in sheet 2. The data in column A is dummy data generally spans 100's of rows not just 10 as in the example.

The purpose of the code is to be able to put a list of file names in column a in sheet 1 and extract data from those files in a folder. The data extraction works fine. The reson for adding the file names is so that I know what file the data came from.

View 1 Replies View Related

Building Macro To Extract Data From One File Into Another Different File

Feb 21, 2014

I need to set up an automated process to open an existing .xls file, extract the data from specific cells located in that file and insert it into a totally different file that I have preformatted to accept this data.

Example scenario:

If I have "that_file.xls" and it is unopened, but it contains data in cells "A2 thru F2" that I need to extract... then I have "this_file.xls" , which is open, and set up with all my calculation cells and a specific layout (lets say it has cells "D8, E9, F10, G11, H12, and I13"). I want to be able to add a button to "this_file.xls" to run a macro that would open a file search window where I can select "that_file.xls", and then it will automatically extract the data from "that_file.xls" into "this_file.xls" as follows:

A2 to D8
B2 to E9
C2 to F10
D2 to G11
E2 to H12
F2 to I13

View 4 Replies View Related

Extract Data From One File To Another

Apr 13, 2009

I have a report that is downloaded off a company database and creates a report that is attached.
Is there a way to create a macro to extract some data that I need and leave the rest:

I need to keep and everything in the assigned column
PB ID (A3), Issue (B3), Group Code (J3), Group Name (K3), Sub group id (L3), Sub Group Name (M3),Subject ID (L3), Subject Group Name (M3), Subject ID (N3), Subject (O3), PB Status (P3), CPM Report Name (T3), CPM Profile Name (U3), Profile State (V3).

The worksheet's name changes so I can't reference the worksheet. Attached is a copy of what I get when downloaded.

View 11 Replies View Related

Extract The Data From Each File

Jan 24, 2010

I have my Excel workbook open with 690 files hyperlinked to the specific folder on my documents, if I click one link the folder opens fine with the file I am looking for.

What I need is one of you genius's to invent a code so that I can highlight my 690 files and extract the data from each file and input that into a seperate workbook.

View 9 Replies View Related

Ranking Within Subset Of Data?

Jun 24, 2014

I have a workbook of data that I created a pivot table with. From there I need to rank each value of the NES, column C, within the corresponding Reporting Structure, column A. The table that I created will be update with data on a monthly basis and I don't want to have to redo the rankings every month and just have it refresh.

View 2 Replies View Related

Using CORREL On A Subset Of Data

Jul 8, 2009

I have a set of data that can be divided into sub-sets. I've attached the sheet of data. There are 5 sub-sets and each of these has 5 sub-sets. The sets are defined by the Portfolio and End columns.

So, the 25 sub-sets look like:
10 INTL
20 INTL
30 INTL
40 INTL
50 INTL

10 LCG
20 LCG
30 LCG
...

I'm wondering if there is a way to write a formula in cell N10 that basically pulls in '10' and 'INTL' and finds the correlation on only that sub-set of data. So I guess I want a formula that returns a range such that =correl(Range1, Range2) will work. Also, the length of the ranges will vary, so trying to write an INDIRECT(ADDRESS... will not work. I tried an array-formula in cell N10, but it didn't work. I also included my expected output. in M18:O24.

I know I can do this in other ways, but I really want to learn if there is a way I can do this with 1 formula that I can just drag down. I guess its more of a learning opportunity than something that needs to get done.

View 4 Replies View Related

Extract Data From Text File

Feb 10, 2012

My data looks like this - it's a text file that I import into Excel.

What I'm looking for is operations that require welding, as indicated by the "Weld:" in Row 61. If it is a weld operation, I want to know the time (121.705) and the Operator involved (Opr 2 - Row 64).

I'm simply using an IF statement in a loop to extract these specific cells:

Range("N2").Select
Do
ActiveCell.FormulaR1C1 = "=IF(MID(RC[-13],11,5)=""Weld:"",LEFT(RC[-13],3),"""")"
ActiveCell.Offset(1, 0).Select
Loop Until IsEmpty(ActiveCell.Offset(0, -13))

Because I don't know how to write "real" code, it does a similar loop 5 times. Once to pull the sequence number (the first number), then the time, then I have 3 separate columns looking for Operator 1, 2 or 3, respectively. Once those 5 loops are complete there is a pivot table that summarizes the sequences for each operator.

It works fine, but it's slow. Some of the text files have 10,000 lines in them.

View 9 Replies View Related

Extract Data From A Source File

Mar 7, 2007

I need to extract data from another source file using VBA. I have problems copying the extracted data and format into the required data format. And also, how do i delete the row that is not required in the output file, in the below example: The row, D0, is not needed. An Example Data Format From the SOURCE file:...............

View 2 Replies View Related

Excel 2007 :: Extract Data From File

Feb 12, 2014

Extracting data from an excel file, the data needed in lies in one column.

in this line

<GPSPosition pntRef="GPS_Auto_0080" wgsLatitude="33.334329659885" wgsLongitude="44.405736558207" wgsHeight="27.615921">

i need to get a table with three columns shows

wgsLatitude, wgs Longitude , wgsHeight
33.334329659885 ,44.405736558207 , 27.615921
etc

and get rid of all other information

this is an example of the how the file look like

---------Column N -------------------
</Feature>
</GPSPosition>
</GPSSetup>
<GPSSetup id="GPSSetupID_18" GPSReceiverDetailsID="GPS_1" antennaHeight="1.660000" stationName="GPS_Auto_0080">
<GPSPosition pntRef="GPS_Auto_0080" wgsLatitude="33.334329659885" wgsLongitude="44.405736558207" wgsHeight="27.615921">

[code].....

seems from above that there are too many data not needed the only thing need to be exracting is one lies of GPSPosition Line.

View 2 Replies View Related

Extract Raw Data From Text File Into A Layout

Feb 4, 2014

I need a macro created, which extracts data from the text file, and displays the low level detail which is on the text file.

I have created a sample of the desired results on a tab called "Low Level Results".

I have already created a macro already which extracts data from the text file, but this gives me a high level view and the results of this is on the tab "High Level Results" ( which you might be able to adapt)

Please find attached two files,
Text File,
And Excel spreadsheet

View 2 Replies View Related

Extract Data From Non-structured Text File

Sep 17, 2006

I have a text file (EP-User.txt) contains records of User information like the example below:

[User]
org_id=HR
uid=JohnChen
role=employee
email_address=John@etex.com
first_name=John
last_name=Chen
job_title=Manager
country=USA
language=EN
time_zone=GMT-8
street=3
city=MX
state=NY
zip=123456
telephone=09847684
fax=23469483.....................

The fields of each User record may not appear in sequence and some of the fields may not appear in other User record. The file contains thousands of User records.

1. I need to extract the User records (only certain fields) into excel for data analysis and manipulation (fill-in missing value in certain fields).

2. After analysis and manipulation in excel, I need to export the data back to the original text file format again.

View 9 Replies View Related

VBA - Download Excel File From Internet And Then Extract Data Out Of It

Dec 20, 2012

I'm trying to download an Excel file from the internet and then extract data out of it. The problem is that I don't get any errors, yet the file downloaded is only 1kb in size. The extraction bit works, but the file is empty. The actual file is size 350KB.

Code:
Sub ExtractDataTest()

Dim FileNum As Long
Dim FileData() As Byte
Dim MyFile As String
Dim WHTTP As Object

On Error Resume Next

[Code] ....

View 1 Replies View Related

Extract Data Of Different Width From Text File To Excel Using VBA?

Jan 15, 2014

I am looking to import data in text file to Excel sheet. Here is the main catch - All the data are not of fixed length and are in multiple lines as in the example below.

Text File:
ID001 Dr Dang 01012011 Male
USA Married 123

Below is how I expected the data extraction in Excel:
ColumnA ColumnB
CardID ID001
Name Dr Dang
DOB 01012011
Sex Male
Country USA
Status Married
Pin 123

View 3 Replies View Related

Extract Data From A Specific Location In A Text File

Aug 7, 2006

I have been trying to work this out by looking at other posts (mostly concerning Binary Access) but can't figure it! The source text files I am using can vary in length from 4,000 characters to well over 100,000 characters. However the data I am looking for always starts 40 characters from the end of the file and is 10 characters long! I need my macro to pick out this data and store it as a string (so it can be added to an array and exported to a worksheet later)

View 2 Replies View Related

Data Validation - Creating Subset Choices Based On Adjacent Column Choice

Oct 27, 2013

I am limiting choices in a certain cell to a list via data validation (using data validation, allow - list and pointing to the source). I want to limit the next set of choices in the next column (in this example in Column C) for the user based on the choice made in the adjoining cell. For example to keep it simple I will use the following: if the user selected "Fruit" in B1, then the options in C1 would only show "Oranges","Apples", "Pears". If however the user selected "Veg" it would only show "Cucumber", "Lettuce", "Spinach", "Radishes" in the drop down in column C. I can put a prefix in front of the column C data validation list if that is needed to narrow down e.g. FR-oranges, FR-apples etc.

A B C
1 Fruit Oranges
2 Veg Lettuce
3

Data Validation source for Column B (H2:H4)
Fruit
Veg
Nuts

Data Validation for Column C: (I2:I10)
Oranges
Apples
Pears
Cucumber
Lettuce
Spinach
Radishes
Almonds
Peanuts

View 3 Replies View Related

Sum Of The Max's For Each Subset

Mar 16, 2009

Looking for a "oneliner: or CSE perhaps that sums the maximum values for each subset. See example below. The answer should be "9".....

View 9 Replies View Related

How To Subset A Range

Oct 8, 2013

I have a sub where I pass in a 1200 row by 8 column named range. Inside the sub I want to create a single column, 1200 row range. I also pass in which column I want to use of the 8 in the big range. So I pass in a number between 1 and 8. I create a new range, but i am not sure how to reference a particular column. I am trying to avoid looping.

View 6 Replies View Related

Extract Date From File Name

Dec 19, 2009

I need to extract the date from the following file name format:

C:Documents and SettingsRezDesktopExcel forumQueue Performance Phone Daily15_Dec_2009.csv

i have macro running where this file path gets save as a string and i can paste this string in a cell, is there a way i can use a few extra line of code to extract only the date from this string and paste only the date? or the other way for this would be use formula to convert this to a date.

View 5 Replies View Related

Extract File Properties

Mar 1, 2012

I have a folder with some 126 word document files.

What I need is to create list of file names in a column & its properties like Author, Date modified in adjacent columns of each file..

View 1 Replies View Related

Extract File Name From Path

Jan 10, 2008

I am having trouble with a macro of mine. Essentially it opens a file, based on user input (Full path is stored in variable FilePath), but then I want to select that workbook, and therefore need just the .xls filename. I figured I would create a new variable, FileName, to pull out the filename.

How can I edit the string in my macro to extract just the filename.xls from the full path?

View 9 Replies View Related

Extract Tables From DXF File

Aug 25, 2009

I want to extract tables from the .dxf drawing format for use in excel. I know it may sound strange to some of you but this indeed is my requirement. I tried very hard on net but could not get a converter for this task.

View 9 Replies View Related

Create Subset Table

Feb 18, 2009

I've got a table on a worksheet (daylies) with daily data, dates in A6, A7, A8, ..., various data in columns B, C, D, ... .

Now I would like to make a subset table on a separate worksheet (weeklies) with just weekly snapshots, i.e.,

snapshot from daylies off row 6 on row 2 of weeklies,
snapshot from daylies off row 13 on row 3 of weeklies,
snapshot from daylies off row 20 on row 4 of weeklies etc.

Is this possible or do I have to use the sledge hammer technique of copy and paste?

View 4 Replies View Related

Comparing Subset And Getting Respective Value

Jan 20, 2013

I'm facing a problem wherein i have two tables A& B.

Table A has two columns and 40834 records(rows).first column is userid and second column is activeyn with respective values (0 or 1) for each userid

Table B userid column is a subset of Table A and has two columns and 411 records(rows).first columns is userid and second column is activeyn with respective values (0 or 1) for each userid.

Now I want to get activeyn value from table A of all the 411 records(userid's) in Table B.

View 3 Replies View Related

Finding First Item In Subset

Jun 12, 2013

I have a list that kind of looks like this. I sorted it by date, then by location, and then by time. I need to find the earliest item in one location on a given day and display as a list.

datelocationtime
6/1/2013 A730
6/1/2013 A745
6/1/2013 A750
6/1/2013 B800
6/1/2013 B810
6/1/2013 C730
6/1/2013 C745
6/1/2013 C800
6/1/2013 C815
6/2/2013 A730
6/2/2013 A745
6/2/2013 A800
6/2/2013 A815
6/2/2013 B700
6/2/2013 B800
6/2/2013 B815
6/2/2013 C800
6/2/2013 C815

View 10 Replies View Related

Saving Subset Of Worksheets

Nov 4, 2008

I am trying to e-mail a portion of a spreadsheet that I have. My approach is the following: I save a copy in a temporary folder, open that copy, remove all the sheets that I don't need to send out, save it (same name as the e-mail subject), and then e-mail as an attachment.

The current approach does not remove the macros and references though. I use the following to remove the macros and references:

View 3 Replies View Related

Copy Subset To Different Sheet

Jan 24, 2007

I've got a list of employees with their division and a bunch of other data in each row. I want to copy each and every row to another sheet based on the division.
_______________________________
ID | Name | Division | Other
4 | Joe | South | up
5 | James | South | over
8 | Jim | North | down
9 | John | East | left
14 | Jerry | East | right

Assuming "ID" is A1 and the list is sorted by Division, I need some code to accomplish my goal. I know C/C++ so I understand the principles of programming but I'm just learning the VBA syntax. First thought is to loop through each row moving them individually but then I have to worry about putting it in an open row on the other sheet. Then I thought about finding the first row that contains the target division and, since the data is sorted by division, select each subsequent row and copy the entire selection at once to avoid fumbling around in the destination sheet. Hopefully someone out there can make sense of this and help out. Please let me know if I need to elaborate.

View 9 Replies View Related

Extract Newest File From Directory

Jul 21, 2008

I have an excel spreadsheet that has a list of pathways to different folders (ex. Q:TechnicalY001) in each row. I want a macro that will search each of the folders I list in a range of cells and return the most recent file by the Date in the filename:

Example: Cell A1 contains folder path Q:TechnicalY001
Cell A2 contains folder path Q:TechnicalY002

The macro would return the most recent file in Y001 and dump the filename into cell B1. Then it would return the most recent file in Y002 and dump the filename into B2.

After I have all of the most recent filenames, I want to be able to search each of those files for data in certain cells and then dump that data into the spreadsheet. The cells are always going to be the same in each file.

View 14 Replies View Related

Extract Label From Text File

Nov 2, 2011

I want to extract particular label from the text file named 'Branch : xxx" i what to extract the xxx from the text file and save it as worksheet name, is that possible through a macro? Then if required i will import the text file through the recorded macro.

View 1 Replies View Related

Extract Date From File Name & Format

Aug 30, 2007

I'm just wondering how you would go about extracting a date from a filename and formatting it into a different format so you can . Find with it. The file names are always in the same format with the same prefix. So each file is something like ABCDEFGyyyymmdd.xls. I'm really lost on where I should start with this one

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved