Identifying text file names and importing on single Excel sheet

Hey!
Does anybody can help me with Excel VBA macro code in order to import data from text files into single Excel spread sheet? I want to create User Form where user can select start and end date of interest and macro code will import
bunch of text files depending on user demands...
My text files are named: 20130619004948DataLog.txt (meaning: yyyy mm dd hh mm ss). Text file contains recordings for each 15 seconds... It would be great to omit time tail (meaning that user can only specify date). Text files for one day of interest (I have
text files covering whole year):
20130619004948DataLog.txt
20130619014948DataLog.txt
20130619024948DataLog.txt
20130619034948DataLog.txt
20130619044948DataLog.txt
20130619054948DataLog.txt
20130619064948DataLog.txt
20130619074948DataLog.txt
20130619084948DataLog.txt
20130619094948DataLog.txt
20130619104948DataLog.txt
20130619114948DataLog.txt
20130619124948DataLog.txt
20130619134948DataLog.txt
20130619144948DataLog.txt
20130619154948DataLog.txt
20130619164948DataLog.txt
20130619174948DataLog.txt
20130619184948DataLog.txt
20130619194948DataLog.txt
20130619204948DataLog.txt
20130619214948DataLog.txt
20130619224948DataLog.txt
20130619234948DataLog.txt
Option Explicit
Sub SearchFiles()
Dim file As Variant
Dim x As Integer
Dim myWB As Workbook
Dim WB As Workbook
Dim newWS As Worksheet
Dim L As Long, t As Long, i As Long
Dim StartDateL As String
Dim EndDateL As String
Dim bool As Boolean
bool = False ' to check if other versions are present
StartDateL = Format(Calendar1, "yyyymmdd")
EndDateL = Format(Calendar2, "yyyymmdd")
' I am using Userform asking user to select the date and time range of interet,
' However, I want to use only the date to filter the files having the name with that particular date
file = Dir("c:\myfolder\") ' folder with all text files
' I need assistance with the following part:
'1) How to filter and select the files between StartDateL and EndDateL_
'(including files with that dates as well)?
While (file <> "")
If InStr(file, StartDateL) > 0 Then 'Not sure if the statements inside parenthesis is correct
bool = True
GoTo Line1:
End If
file = Dir
Wend
Line1:
If Not bool Then
file = "c:\myfolder\20130115033100DataLog.txt" 'Just for a test that the code works as intended
End If
'This part for the selected text files to be loaded on a single Excel Sheet.
Set myWB = ThisWorkbook
Set newWS = Sheets(1)
L = myWB.Sheets(1).Cells(Rows.Count, "A").End(xlUp).Row
t = 1
For x = 1 To UBound(file)
Workbooks.OpenText Filename:=file(x), DataType:=xlDelimited, Tab:=True, Semicolon:=True, Space:=False, Comma:=False
Set WB = ActiveWorkbook
WB.Sheets(1).UsedRange.Copy newWS.Cells(t, 2)
t = myWB.Sheets(1).Cells(Rows.Count, "B").End(xlUp).Row + 1
WB.Close False
Next
myWB.Sheets(1).Columns(1).Delete
Application.ScreenUpdating = False
Rows("1:1").Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
End Sub

- Make a new Excel file
- Open the VBA editor
- Add a Userform
- Place 2 text boxes and 1 command button on that form
- Paste all code below into the code module of the form
- Download this file:
https://dl.dropboxusercontent.com/u/35239054/FileSearch.cls
- In the VBA editor press CTRL-M and import that file
- Save the Excel file in the directory that contain your text files
- Run the form
You can format the columns of the sheet as you like, e.g. column E:H should be a number with 5 decimal places. The top row can contain some headings. My code did not affect the formatting or the headings.
Andreas.
Option Explicit
Private Sub UserForm_Initialize()
'Just a sample
Me.TextBox1.Value = FormatDateTime(Now, vbGeneralDate)
Me.TextBox2.Value = FormatDateTime(Now, vbShortDate)
End Sub
Private Sub CommandButton1_Click()
Dim StartDate As Date, EndDate As Date
Dim FS As New FileSearch
Dim R As Range
Dim ThisFile As Variant
Dim ThisDate As Date
Dim Data As Variant
Dim Count As Long
'Be sure we have 2 dates
If Not IsDate(Me.TextBox1.Value) Then
Me.TextBox1.SetFocus
MsgBox "No start date"
Exit Sub
End If
If Not IsDate(Me.TextBox2.Value) Then
Me.TextBox2.SetFocus
MsgBox "No end date"
Exit Sub
End If
'Convert to real dates
StartDate = CDate(Me.TextBox1.Value)
EndDate = CDate(Me.TextBox2.Value)
'Time part given?
If Fix(EndDate) = EndDate Then
'No include all files for this day
EndDate = EndDate + TimeSerial(23, 59, 59)
End If
'Correct order?
If StartDate > EndDate Then
ThisDate = EndDate
EndDate = StartDate
StartDate = ThisDate
End If
With FS
'Same path as our file
.LookIn = ThisWorkbook.Path
.FileName = "*DataLog.txt"
'Search all files sort by file name
If .Execute(msoSortByFileName, msoSortOrderAscending) = 0 Then
MsgBox "No data files found in " & .LookIn
Exit Sub
End If
'Clear previous data
Set R = Range("A2").CurrentRegion
If R.Row < 2 Then Set R = R.Offset(1)
R.ClearContents
'Show the user that we are working
Application.Cursor = xlWait
DoEvents
For Each ThisFile In .FoundFiles
'Get the date from the file name
ThisDate = Filename2Date(ThisFile)
'Between our dates?
If (ThisDate >= StartDate) And (ThisDate <= EndDate) Then
'Import at the end of the data
Set R = Range("A" & Rows.Count).End(xlUp).Offset(1)
Data = ReadCSV(ThisFile)
R.Resize(UBound(Data) + 1, UBound(Data, 2) + 1) = Data
Count = Count + 1
End If
Next
End With
'Done
Application.Cursor = xlDefault
If Count = 0 Then
MsgBox "No files match your dates"
Else
MsgBox Count & " files imported"
'Hide the form
Me.Hide
End If
End Sub
Private Function Filename2Date(ByVal Fullname As String) As Date
'Convert e.g "C:\20130601142648DataLog.txt" to the date "01.06.2013 14:26:48"
Dim i As Long, j As Long
i = InStrRev(Fullname, "\")
If i > 0 Then Fullname = Mid(Fullname, i + 1)
Fullname = JustNumbers(Fullname)
If Len(Fullname) <> 14 Then Exit Function
Filename2Date = _
DateSerial(Mid(Fullname, 1, 4), Mid(Fullname, 5, 2), Mid(Fullname, 7, 2)) + _
TimeSerial(Mid(Fullname, 9, 2), Mid(Fullname, 11, 2), Mid(Fullname, 13, 2))
End Function
Private Function JustNumbers(ByVal What As String) As String
'Return only numbers from What (by Rick Rothstein)
Dim i As Long, j As Long, Digit As String
For i = 1 To Len(What)
Digit = Mid$(What, i, 1)
If Digit Like "#" Then
j = j + 1
Mid$(What, j, 1) = Digit
End If
Next
JustNumbers = Left$(What, j)
End Function
Private Function ReadCSV(ByVal Fullname As String) As Variant
'Read a CSV file into an array
Const LDelim = vbCrLf 'Line delimiter
Const FDelim = ";" 'Field delimiter
Dim hFile As Integer
Dim Buffer As String
Dim Lines, Line, Data
Dim i As Long, j As Long
'Be sure the file exists
If Dir(Fullname) = "" Then Exit Function
'Open and read all data
hFile = FreeFile
Open Fullname For Binary Access Read As #hFile
Buffer = Space(LOF(hFile))
Get #hFile, , Buffer
Close #hFile
'Split into lines
Lines = Split(Buffer, LDelim)
'Split the first line and prepare the output
'Note: I assume that all lines have the same number of fields
Line = Split(Lines(0), FDelim)
ReDim Data(0 To UBound(Lines), 0 To UBound(Line))
For i = 0 To UBound(Lines)
Line = Split(Lines(i), FDelim)
For j = 0 To UBound(Line)
'Parse the fields
If IsDate(Line(j)) Then
Data(i, j) = CDate(Line(j))
ElseIf IsNumeric(Line(j)) Then
Data(i, j) = CDbl(Line(j))
Else
Data(i, j) = Line(j)
End If
Next
Next
ReadCSV = Data
End Function

Similar Messages

  • Fix variable text (File Name) when importing INDD into INDD

    More of a fix request than a new feature:
    Simply put, the variable text (File Name) shows the file extension when the document is imported into another INDD regardless of the variable text specifications in the originating document. This is unexpected and undesired.
    Please see problem description in this thread: http://forums.adobe.com/thread/489492?tstart=0

    Seconded. Currently, I don't use this variable in this way, but I can envisage future scenarios where it would be a problem.
    And it seems a strange thing to miss out on ... (why would an INDD file behave different?)

  • Log File name and path to check Excel Download

    Hi ,
    When we download a report in Excel/PDF/HTML is it logged in any log file ? What is the log file name and path?
    Regards
    Anand

    Hi...
    one of my user tried to download the report in excel format. that excel was not opening. then he tried to download the same report again. this time he was able to open thee excel.
    So he wants to investigate why this happened first time. could you please suggest how we can investigate this?
    Regards
    Anand

  • Add date to new text file name and generic text in body

    Okay, I hope this is the right forum. To help manage and keep track of incoming assets/files and I created an Automator workflow with the following: "Get Selected Finder Items → Get Folder Contents → New Text File (w/Show this action when the workflow runs so I can give a unique name).
    This creates a text file with the folder contents listed in the body.
    I would like to know if I can do two things:
    1. Automatically add a date/time stamp to the Save as field so it will automatically have a unique file name?
    2. I also want to add text before the listed contents within the text file. (e.g.: Let's say the folder contents are Volumes/Mac HD/Generic_movie.mov. I want the final text to read:
    "The following file has been moved to the local volume at: Volumes/Mac HD/Generic_movie.mov"
    Is there a way to accomplish either one or both of these with Automator or AppleScripts?
    Thanks.

    I would like to know if I can do two things...
    This might address your first concern:
    *1) Get Selected Finder Items*
    *2) Get Folder Contents*
    *3) New Text File* -- select a destination folder and check *Show Action When Run*
    *4) Rename Finder Items:*
    Choose *Add Date or Time* from the popup
    Date/Time: select Created, Modified, or Current - Format: *Month Day Year*
    Where: *After name* - Separator: *Forward Slash*
    Separator: Space - check *Use Leading Zeros* (optional)
    *5) Rename Finder Items:*
    Choose *Add Text* from the popup
    Add: *" at"* -- put a leading space before "at" (without the quotes), and select *after name*.
    *6) Rename Finder Items:*
    Choose *Add Date or Time*
    Date/Time: Current - Format: *Hour Minute Second*
    Where: *After name* - Separator: Dash
    Separator: Space - check *Use Leading Zeros* (strongly recommended)
    +--- End of Workflow ---+
    Save the workflow as an application and use it as a droplet. Drop a desired folder onto the saved applet and enter a name when the dialog appears. The new text file, which will be found in the destination folder, should be appended with a date and time stamp, e.g., *"My Folder List 7/8/2010 at 23-54-09"*
    Tested using Mac OS 10.4.11 and Automator v. 1.0.5
    Good luck; hope this helps.

  • Find exact word in text file tht is present in an excel sheet

    Hi all,
    i want to find words in an text file.
    but the criteria is i want to search words which r already listed in another excel sheet and change the color of these word.
    i used FileInputStream
    and also BufferedInputStream
    cany anyone help me with this

    hi kajbj,
    can u plz tell me how to do in VBA then
    will find out the way to do in java
    Thanx

  • When importing photos with iBooks Gallery widget, is anyone aware of a technique for simultaneously importing the photo's description (or jpeg file name) and writing it into the iBook Author caption field for the imported photo?

    When importing photos with the iBooks Author Gallery widget, is anyone aware of a technique for simultaneously importing the photo's description (or jpeg file name) and writing it into the iBook Author caption field for the corresponding imported photo? I have 4,800 stills to import and can't imagine it's necessary to copy and paste the description for each.

    As always, feel free to use the 'Provide iBooks Author Feedback' menu item for features you'd like added in the future, etc.
    http://www.apple.com/feedback/ibooks-author.html
    As for AS, I'm not sure anyone has sniffed iBA's dictionary yet...google is you friend for hot prospects, I'm sure

  • How to find ATL file name and timestamp of importing for existing DI code?

    A tester is not sure about the version of the ATL code which was imported into his local repository. Is there anyway he can get the imported ATL file name and/or timestamp from the repository or a log file? I searched in both places but couldn't find any information. Did I miss something? This is DI 11.5.3.
    Thanks,
    Larry

    I don't think the information about the source of how the object was created in repo is maintained anywhere, like this version of object was created from ATL or from Designer etc
    but different versions of objects are stored in AL_LANG and its language in AL_LANGTEXT table, if you have not compacted the repo, you may get the last modified time from AL_ATTR table, try getting the data from these table and see if you get any info that is useful for you

  • File Name and File Content  not gettinng passed from Proxy to Business Serv

    Hi All ,
    I have a requirement in OSB , where i need to pick the file from remote Source and FTP the files to Remote Target .Below are the steps which i did to achieve this.
    1.Created a FTP Adapter in JDeveloper to Get the files from Source and a FTP Adpater to Put the files to Target.Inboth the adapters i have choose 'Shema is Opaque'
    2.Imported the wsdl and jca file to OSB
    3.Generated Proxy Service (PS ) and Business service (BS) out of Step 2
    4.I edited the Message flow such a way that , the PS is routed to invoke the BS
    Aslo i assigned $inbound/ctx:transport/ctx:request/tp:headers/jca:jca.file.FileName to a variable 'FileName' in PS
    and in BS service i passed $outbound/ctx:transport/ctx:request/tp:headers/jca:jca.ftp.FileName = 'FileName'
    When i tried to activate my session , the file that is getting written to the target has 0 byte.Also , the file name is also not getting passed from PS to BS
    Can some one help me with the steps on how to use the Xpath , so as to pass the file name and file body from proxy servive to business service.
    Thanks
    John

     I search multiple shares to find a common file name then create a single output file. I will be doing this search and file creation
    for 5-10 different file names. If there is a better way .. certainly open for suggestions. It's working but having issue with
    the cmd file for every file and folder I check. It puts this error out for each run of the process.
      Error message in LOG file:
    Get-ChildItem : Cannot find path 'F:\powershell\-SearchFor' because it does not exist.
     Thanks.
    I tried your code with little changes and saved in Temp folder.
    My CMD file has the below code
    PowerShell C:\Temp\Untitled1.ps1
    It worked.
    Regards Chen V [MCTS SharePoint 2010]

  • File adapter - How to pass File name and path at runtime

    Hi gurus,
    We want to use PI 7.0 as an ftp server and expose the config as a webservice where the service consumer can pass one or more file names and the path to pick them and drop them on a fixed ftp server.
    So precisely, I need to be able to set the file name, target directory parameters in both sender and receiver file/ftp adapters at runtime. is this possible at all ?
    I am aware of passing Adapter specific parameters from sender file adapter to receiver file adapter to create the same folder structure and file names. But my requirement is different. I hope I am clear.
    Could I please get some advise on this .
    Thanks & Kind Regards,
    Jhansi.

    Hi Jhansi,
    Either you can go ahead with dynamic configuration as said by other SDN'ers. Else can go with Java Mapping:
    Here is the code for Java Mapping:
    import com.sap.aii.mapping.api.*;
    import java.io.*;
    import java.text.*;
    import java.util.*;
    public class GetDynamicConfiguration implements StreamTransformation {
    private Map param;
    public void setParameter(Map map1) {
    this.param = map1;
    public void execute(InputStream inputstream, OutputStream outputstream) throws StreamTransformationException {
    try {
    AbstractTrace trace = null;
    // a) Set ouput File name
    String directory=null;
    trace = (AbstractTrace)param.get(StreamTransformationConstants.MAPPING_TRACE );
    param.put(DynamicConfigurationKey.create("http://sap.com/xi/XI/Dynamic", StreamTransformationConstants.DYNAMIC_CONFIGURATION), "");
    DynamicConfiguration conf = (DynamicConfiguration) param.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "Directory");
    String filename =conf.get(key);
    conf.put(key, filename);
    trace.addInfo("File name is "+filename);
    if(filename.equals("in.txt"))
    directory = "/home/ftpxi/in";
    if(filename.equals("test.txt"))
    directory = "/home/ftpxi/in/test";
    if(filename.equals("shweta27.txt"))
    directory = "/home/ftpxi/in/test";
    trace.addInfo("Directory name is "+directory);
    conf.put(key1, directory);
    // b) Just copy input file to output file
    byte[] b = new bytehttp://inputstream.available();
    inputstream.read(b);
    outputstream.write(b);
    } catch (Exception exception) {
    exception.printStackTrace();

  • Pdf portfolio source file name and date in file details

    Is it possible to import the source file name and extension as well as the source file created date in the portfolio file details?  Need to document source to portfolio in working with 3rd parties that will only have the original source.  Need to document what was converted into pdf as not all files in a directory will successfully convert to pdf.  Sometimes need to convert 100's of files.  Manual entry is inefficient.  the file names and modified dates are displayed on the Combine Files dialog.  is there a way to capture the detail on that page?

    I don't need the detail of when the pdf was added to the portfolio.  I
    need know which dwg or jpg or word file was converted and the original
    created date of that file for control of information.
    That is impossible; sorry. For some *very specific* types of conversion to PDF the pdfx:SourceModified XMP tag will be set to show the last-modification date of the source file (for example DOCX files converted using MS Word), but there will never be a human-readable record of the source filename or its creation date unless you have manually added them as document XMP properties after conversion (this is what the "Custom Properties" dialog is for). To embed source data automatically would raise no end of privacy and security problems for customers, who most certainly do NOT want their recipients seeing details of internal documents.
    Without writing a plugin there's no access to the internal workflow of the Combine Files dialog, so you cannot use a script to read the names and dates of the files *before* conversion and store them automatically in the new PDF Portfolio's Fields array.

  • File name and path should be passed as parameter

    hi all,
    i am writing a set of statements into the text file. But i have to pass the file name and also path as a user enterable parameter.
    please suggest me to proceed further.
    for ex: i am storing it as
    output:=text_io.fopen(c:abc\def\out.txt','w');
    right now i am giving like this and storing the data, but now i have to allow file name and path as user parameter.
    please suggest me.
    Thanks..

    Hi,
    for ex: i am storing it as
    output:=text_io.fopen(c:abc\def\out.txt','w');
    right now i am giving like this and storing the data, but now i have to allow file name and path as user parameter.
    please suggest me.Well, how hard can it be?
    You have to get those two parameters from your application into two variables, say "v_filename" and "v_pathname", and then create the file just the same way using the variables to construct the full path :
    output:=text_io.fopen(v_pathname || '\' || v_filename,'w');

  • File name and Date Display as an obj not the data

    All,
         The issue that I am having is that when I view a Visio file hosted on SharePoint. The file was created in Visio 2007 and when it is opened by Visio 2007 and Visio Viewer in SharePoint. The file name field object and date
    modified object show the information. The issue is when the file is opened by a device that has Visio 2010 the information does not show. Is there something that I can do for these users to have it show correctly.

    Hi,
    Which way did you open the Visio 2007 file in SharePoint?Opened it in the browser or downloaded it to open? I had test in my environment. Insert a text box>Add a data/time field, it worked fine both in Visio 2007, 2010.
    Thus, let‘s do some test to narrow down the issue’s reason. 
    1.Download the Visio 2007 file and open it with Visio 2010.
    If it worked fine, the issue seems more related to Visio object and sharePoint connection.
    If it does not display the information in Visio 2010 by a device client, the issue was more related to Visio 2010 client.  
    2.Create a new drawing included file name and Date
    field in Visio 2010.
    If the new drawing displays correct, the issue is more related the original, please try to repair the file or re-create the file name and Date filed.  
    If the new drawing still displays incorrect, please try to start Visio 2010 in safemode, some third-party add-ins my be casued the issue.
    If the issue still exists, try to repair Visio 2010.
    Regards,
    George Zhao
    TechNet Community Support

  • Iphone contacts "not available" to car phonebook after messing around with Outlook.pst file names and backups. Iphone4 connects to car though and other phones connect properly.

    iphone contacts "not available" to car phonebook after messing around with Outlook.pst files, names and backups, on my ms XP 2003 laptop. I substituted a much smaller new Personal Folder -Contacts File, with a smaller list of phone numbers (4 only as a test) which successfully synced to the iPhone 4. The iPhone connects to the Skoda Octavia HandsFreeSystem OK (Bluetooth works fine), but now iPhone wont load the new Contacts as it did originally. However a family Nokia (never messed with) can connect properly. So must be the iPhone or more likely an Outlook.pst \ Contacts problem. Ideas?

    After fiddling a little more, the following fixed my corrupted outlook.pst file:
    1) I made a backup
    2) In outlook under file, I exported the calendar to excel
    3) In outlook under file, I imported the calendar back to outlook
    And voila, it worked.

  • Display file name and remove error from log output

      This script is working great from the GUI but when I call it from a cmd file from a job scheduler it throws out errors. I also want to display from is location the file name and it's byte count(ForEach($File in $Files)) so I can tell if any of the
    files being combined where actually empty. It wants to search the current location from the sever not just-Locations parm..
    Error message in LOG file:
    Get-ChildItem : Cannot find path 'F:\powershell\-SearchFor' because it does not
     exist.
    It's trying to find file install.cmd from where script starts and all the -Locations(which is only the search parm)
    Function Search-Files{
    Param([String[]]$Locations, $SearchFor, $AppendTo)
    Begin
    If(-Not (Test-Path $AppendTo)){New-Item $AppendTo -ItemType File -Force}
    Process
    ForEach($Location in $Locations)
    $Files = Get-ChildItem -Path $Location -Filter $SearchFor -Recurse
    ForEach($File in $Files)
    Get-Content -Path $FIles.FullName | Out-File $AppendTo -Append
    End{}
    Search-Files -Locations "\\Server1\c$\Temp", "\\Server1\c$\Test1" -SearchFor "Install.cmd" -AppendTo "C:\Temp\Search.log"
    Thanks.

     I search multiple shares to find a common file name then create a single output file. I will be doing this search and file creation
    for 5-10 different file names. If there is a better way .. certainly open for suggestions. It's working but having issue with
    the cmd file for every file and folder I check. It puts this error out for each run of the process.
      Error message in LOG file:
    Get-ChildItem : Cannot find path 'F:\powershell\-SearchFor' because it does not exist.
     Thanks.
    I tried your code with little changes and saved in Temp folder.
    My CMD file has the below code
    PowerShell C:\Temp\Untitled1.ps1
    It worked.
    Regards Chen V [MCTS SharePoint 2010]

  • Copy file name and info from finder window

    I need to get the file name and file size for lots of files in lots of folders into a text file or excel file. I have found the way to copy the file path into text edit, but can't figure out how to copy all the info in a file window. Is there a way to do this?

    It's easily done with Terminal.
    cd (drag folder into Terminal window, press return). Then:
    ls -l > ~/Desktop/list.txt
    A file called "list.txt" will appear on your Desktop, containing a list of files from the folder, along with their modification dates, file sizes, and ownership/permission info.

Maybe you are looking for

  • Error while creating Inter-company billing document

    Hi All, Help me to solve below error while creating inter-company billing document with ref to delivery document. " 1190984113 000000 Company code is not defined" Thanks for your help.

  • Adobe Illustrator close in Mac

    Hi, guys. I have installed in my work, on  my Mac, the Adobe Illustrator. But ever I try save everything, the Illustrator show me this message: Unkown error occurred. I used Illustrator in portuguese. Grateful now to any help. The error is attached.

  • How can I stop my old apple macbook pro from syncing with my new computer and iPhone?

    How can I stop my old apple macbook pro computer from syncing with my new apple computer and iphone?

  • EUL version 3.1.13 in a 4.1.x enviroment

    Hey there. This is an interesting - and perplexing - one to me. I'm combining 2 EULs together into 1. All that's fine, but where I'm surprised is that I'm running Disco client 4.1.48.08. When I run the following SQL query: SELECT 'EUL_OWNER' which_eu

  • Photoshop from Cloud Not Downloading

    I purchased the Creative Cloud today. All apps dowloaded and installed - except for 1: Photoshop CS6.  It gets about halfway downloading, then says there is an error (-60). Ideas? I need to use this today