I would like to get only specific channels from several .csv files and concatenate into one group.

Hello,
I am working with other groups and getting the data in daily .csv files.  When I use the "concatenate groups" script along with a script on importing files, I end up getting a huge file that takes about an hour to concatenate.  In order to reduce the amount of time and memory that this takes, I was hoping that someone could help me modify the script so that I could just list the channel name that I am interested in and concatinating only those channels rather than all of them. 
For example, if voltage, temperature, pressure and time data are taken daily for 30 days, I would like to import only the temperature and time data (from .csv format) and concatenate into one group.
I have attached the .vbs files that I use.
Thanks in advance,
Alan
Attachments:
Import and concatenate files.zip ‏9 KB

Hi Alan,
Actually, the feature you're asking for is already in the code of mine that you sent back. Look on line 11 of the main VBScript:    ChannelSet = "" ' "" or "1-" (DataPlugin) or "Sheet1" (EXCEL Wizard) 
If this "ChannelSet" parameter is set to something other than "" or "1-" then it is used in line 78:
Call DataFileLoadSel(FilePaths(i), DataPlugin, ChannelSet) 
Yo can specify the channel indices to load with an expression like this:
ChannelSet = "[1]/[1],[3]" 
Let me know if you have further questions,
Brad Turpin
DIAdem Product Support Engineer
National Instruments

Similar Messages

  • Having trouble reading specific lines from a text file and displaying them in a listbox

    I am trying to read specific lines from all of the text files in a folder that are reports. When I run the application I get the information from the first text file and then it returns this error: "A first chance exception of type 'System.ArgumentOutOfRangeException'
    occurred in mscorlib.dll"
    Below is the code from that form. 
    Option Strict On
    Option Infer Off
    Option Explicit On
    Public Class frmInventoryReport
    Public Function ReadLine(ByVal lineNumber As Integer, ByVal lines As List(Of String)) As String
    Dim intTemp As Integer
    intTemp = lineNumber
    Return lines(lineNumber - 1)
    lineNumber = intTemp
    End Function
    Public Function FileMatches(ByVal folderPath As String, ByVal filePattern As String, ByVal phrase As String) As Boolean
    For Each fileName As String In IO.Directory.GetFiles(folderPath, filePattern)
    If fileName.ToLower().Contains(phrase.ToLower()) Then
    Return True
    End If
    Next
    Return False
    End Function
    Private Sub frmInventoryReport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim intcase As Integer = 1
    Dim strTemp, strlist, strFile As String
    Dim blnCheck As Boolean = True
    strFile = "Report Q" & intcase.ToString & ".txt"
    Do While blnCheck = True
    strFile = "Report Q" & intcase.ToString & ".txt"
    Dim objReader As New System.IO.StreamReader("E:\Furry Friends Animal Shelter Solution\Furry Friends Animal Shelter\" & strFile)
    Dim allLines As List(Of String) = New List(Of String)
    Do While objReader.Peek <> -1
    allLines.Add(objReader.ReadLine())
    Loop
    objReader.Close()
    strlist = ReadLine(1, allLines) & "" & ReadLine(23, allLines)
    lstInventory.Items.Add(strlist)
    intcase += 1
    strTemp = intcase.ToString
    strFile = "Report Q" & intcase.ToString & ".txt"
    blnCheck = FileMatches("E:\Furry Friends Animal Shelter Solution\Furry Friends Animal Shelter\", "*.txt", intcase.ToString)
    Loop
    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim intcase As Integer = 1
    Dim strTemp, strlist, strFile As String
    Dim blnCheck As Boolean = True
    strFile = "Report Q" & intcase.ToString & ".txt"
    Do While blnCheck = True
    strFile = "Report Q" & intcase.ToString & ".txt"
    Dim objReader As New System.IO.StreamReader("E:\Furry Friends Animal Shelter Solution\Furry Friends Animal Shelter\" & strFile)
    Dim allLines As List(Of String) = New List(Of String)
    Do While objReader.Peek <> -1
    allLines.Add(objReader.ReadLine())
    Loop
    objReader.Close()
    strlist = ReadLine(1, allLines) & "" & ReadLine(23, allLines)
    lstInventory.Items.Add(strlist)
    intcase += 1
    strTemp = intcase.ToString
    strFile = "Report Q" & intcase.ToString & ".txt"
    blnCheck = FileMatches("E:\Furry Friends Animal Shelter Solution\Furry Friends Animal Shelter\", "*.txt", intcase.ToString)
    Loop
    End Sub
    End Class
    Sorry I'm just beginning coding and I'm still a noob. Any help is appreciated. Thank you!

    Ok, so if I'm following this correctly you should be able to just loop through all of the files in that folder whose file name matches the pattern and then read the first 22 lines, recording only the first and the last.
    Exactly how you store the animal data probably depends on how you are going to display it and what else you are going to do with it.  Is there anything other than name and cage number that should be associated with each animal?
    You might want to make a dataset with a datatable to describe the animal, or you might write a class, or you might just use something generic like a Tuple.  Here's a simple class example:
    Public Class Animal
    Public Property Name As String
    Public Property Cage As String
    Public Overrides Function ToString() As String
    Return String.Format("{0} - {1}", Name, Cage)
    End Function
    End Class
    With that you can use a routine like the following to loop through all of the files and read each one:
    Dim animals As New List(Of Animal)
    Dim folderPath As String = "E:\Furry Friends Animal Shelter Solution\Furry Friends Animal Shelter\"
    For Each filePath As String In System.IO.Directory.GetFiles(folderPath, "Report Q?.txt")
    Using reader As New System.IO.StreamReader(filePath)
    Dim lineIndex As Integer = 0
    Dim currentAnimal As New Animal
    While Not reader.EndOfStream
    Dim line As String = reader.ReadLine
    If lineIndex = 0 Then
    currentAnimal.Name = line
    ElseIf lineIndex = 22 Then
    currentAnimal.Cage = line
    Exit While
    End If
    lineIndex += 1
    End While
    animals.Add(currentAnimal)
    End Using
    Next
    'do something to display the animals list
    Then you might bind the animals list to a ListBox, or loop through the list and populate a ListView.  If you decided to fill a datatable instead of making Animal instances, then you might bind the resulting table to a DataGridView.
    There are lots of options depending on what you want and what all you need to do.
    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

  • Search and Delete a specific record from a CSV file

    Hi All,
    I am new to java . I want to search for the records from CSV file and delete the row form the file.
    Below is my Sample .csv
    100||a100||1b100
    200||b200||dc300
    200||bg430||ef850
    400||f344||ce888
    Now I need some help in below requirements.
    1.How to delete a record having value 200 and b200?
    2.If record already exists how to update the existing record with new values?
    Please share your ideas or give me some code snippet..
    Thanks in Advance

    In that case Do i need to write the entire contents of my file to a hash table(sumthng like this) and modify the Second row in my case with the new values..
    is it possible??I would have done like this (though there maybe better methods)
    1- create a class representing the record.
    class Record{
          String field1;
          String field2;
          String field3;
          // and so on....
          //setters
          public void setFeild1(String str){
              field1=str;
          // and so on....
          //getters
          public String getFeild1(){
              field1=str;
          // and so on....
          public String toString(){
               return(field1+"||"+field2+"||"+field3);
    }//end class2- then create an ArrayList meant to have objects of this class (Generics).
    3- read from the file , create a new Record Object and add that to the ArrayList
    4- perform operations on the ArrayList (you can add new records, and delete record, update......)
    5- write the record back to file using 'toString()' method.
    is there ne sample code available for thisdon't know, but you rarely get full code on forums.....outline given can be followed
    Thanks!
    Edit: It appears that 'r035198x' and me have the same point. This shows that this methodology is almost a standard way( if we ignore the Random access files.....)
    Edited by: T.B.M on Jan 13, 2009 2:39 PM

  • I would like to save only selective web sites in my cache, and everything else gets deleted when I close the browser

    Lets say I have a website called xyz, I would like to keep the cache from this site and have everything else deleted when I close the browser.

    The involved CSS code can be found in this file that you can open via the location bar.
    * chrome://global/skin/autocomplete.css
    Look for class .ac-emphasize-text and apply modified rules as you like.
    You need to add the !important flag to override rules.
    Add code to the <b>userChrome.css</b> file below the default @namespace line.
    *http://kb.mozillazine.org/userChrome.css
    <pre><nowiki>@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */
    @namespace html url("http://www.w3.org/1999/xhtml");
    html|span.ac-emphasize-text {
    box-shadow: none!important;
    background-color: transparent !important;
    border-radius: 0px;
    text-shadow: none !important;
    </nowiki></pre>
    The customization files userChrome.css (user interface) and userContent.css (websites) are located in the <b>chrome</b> folder in the Firefox profile folder.
    *http://kb.mozillazine.org/Editing_configuration
    You can use this button to go to the currently used Firefox profile folder:
    *Help > Troubleshooting Information > Profile Directory: Show Folder (Linux: Open Directory; Mac: Show in Finder)
    * Create the chrome folder (lowercase) in the <xxxxxxxx>.default profile folder if this folder doesn't exist
    * Use a plain text editor like Notepad to create a (new) userChrome.css file in this folder (the names are case sensitive)
    * Paste the code in the userChrome.css file in the editor window and make sure that the userChrome.css file starts with the default @namespace line
    * Make sure that you select "All files" and not "Text files" when you save the file via "Save file as" in the text editor as userChrome.css. Otherwise Windows may add a hidden .txt file extension and you end up with a not working userChrome.css.txt file

  • I would like to get siri working on my 3G iphone 4s and since upgrading to ios 7 my speakers work intermittently can anyone help me please

    I upraded my 3G iphone 4s to the ios7 and have had trouble with the speakers  working on and off  and I would like to know how to get siri  and would like to know how to do that so that I may use it in my hands free  equipped vehicles can anyone help me please ?

    First, this is the Photoshop (full version) forum - you may be able to get more pertinent and specific help down at the Photoshop Elements forum:
    http://forums.adobe.com/community/photoshop_elements
    Generally speaking, one edits image files then saves the results on one's hard drive, so the photos don't "go into" Photoshop, but rather they are just files on the disk.  However, I'm not sure whether you used a feature of Elements I may not be familiar with.  You may be best off asking Elements experts.
    -Noel

  • How to read and select only a specific lines from a CSV file. Pls help

    I have a java application to read a CSV file. I've already managed to read them all and output it to System.out.println(). Now the problem is I want to select a specific row of the records. How do I do it? Below is the codes i've typed.
    FileReader fr = new FileReader(fileName);
    BufferedReader inFile = new BufferedReader(fr);
    StringBuffer buf = new StringBuffer();
    String line = null;
    while ((line = inFile.readLine()) != null) {
    buf.append(line);
    buf.append("\n");
    String inString = buf.toString();
    System.out.println(inString);
    This is the record that i want to read. For example, I want to select n print out line "80,2.90,3.00,3.10,3.20,......."
    [Factor1]
    Time [s],0.00,0.10,0.20,0.30,0.40,0.50,0.60,0.70,0.80,0.90,1.00,1.10,1.20,1.30,1.40,1.50,1.60,1.70,1.80,1.90,2.00,2.10,2.20,2.30,2.40,2.50,2.60,2.70,2.80,2.90,3.00,3.10,3.20,3.30,3.40,3.50,3.60,3.70,3.80,3.90,4.00,4.10,4.20,4.30,4.40,4.50,4.60,4.70,4.80,4.90,5.00,5.10,5.20,5.30,5.40,5.50,5.60,5.70,5.80,5.90,6.00,6.10,6.20,6.30,6.40,6.50,6.60,6.70,6.80,6.90,7.00,7.10,7.20,7.30
    Phi-0 [dB],-0.86,-0.80,-0.80,-0.99,-0.56,-0.53,-0.95

    If you know how many bytes each line is, you can use RandomAccessFile to skip directly to the byte position corresponding to your desired line. Otherwise, you'll have to read each line and just ignore the ones you don't want.

  • I have my aunts mac book which is her daugth's who past a way this last summer.  My Aunt would like to get delited e-mails back that Tami worte and recieved from others.  Can you please help me help her.  I know I have a hard time spelling please try.

    This is so important to my aunt Doreen!!  She wants to know Tami's last Thoughts, friends, Doc., Boy Friend that walk out on her and way.  You can only image the questions a mom would have.  Please Doreen calls me all the time to see if I found a way.  I have ran into close door after close door.  You have to be my open door. Pam.

    This LINK may be of some use in solving your problem.
    You might also contact the email provider to see if they can retrieve deleted mail from their servers.

  • How to filter a get-adcomputer command using a text/csv file and output to a CSV

    OK, so I'm in the process of trying to get a Windows 7 refresh completed for a large client... I had the bright idea to use AD to find what computers are listed as XP, and determine our progress using that.  Well, I run get-adcomputer, and it returns
    the results... a whole lot of results that really aren't active anymore.  I obtained a list of systems that have been disposed of, holding for disposal, etc... now my problem is I can't quite figure out how to get that list to be used to exclude those
    computers from the results... I execute my script, it runs, but it seems to get stuck in a loop... I'm sure I'm missing something VERY basic, but I can't figure it out.  This is the first time I've ever attempted to use the get-content commandlet, so
    again, I'm sure I'm doing something stupid. 
    Any help will be greatly appreciated!
    import-module ActiveDirectory
    $exclude = get-content c:\scripts\excludes.csv
    ForEach ($entry in $Exclude)
    $Excl = "*$entry*"
    get-adcomputer -filter {Name -notlike $excl} | select Name,operatingsystem
    } Export-CSV c:\scripts\xpfil.csv

    OK, this one with a little tweaking on my excludes.txt worked... I'd really like to know what the
    ?{$a -notcontains $_.name}
    is doing... Step through it if you can... that way next time I'm not beating my head against this same rather solid wall!
    ? is an alias for Where-Object. I avoid using aliases in posts, as they usually confuse people.
    The concept is that you're reading your exclude list into a variable and then verifying that the variable doesn't contain the computer name that you're currently processing in the pipeline. In my case, I'm running each object through a ForEach-Object loop.
    Make sense?
    Don't retire TechNet! -
    (Don't give up yet - 12,830+ strong and growing)

  • I can't get video to loop exporting an OAM file and importing into Muse. Seems to ignore all triggers.

    I've tried everything I can think of, but triggers are ignored. I've tested in Safari and Firefox so far. Tested in Muse Preview. Tested in An. Nothing is paying attention to the trigger I have set up.
    I've used a label to get it to loop back to the beginning. I've used zero to get it to loop back. I've searched the web, YouTube, and here looking for answer none will fix this. No errors in the error box BTW. Been back to Lynda.com re-re-viewing videos. All seems fine, but it isn't.
    Website is here: http://www.moviesandfx.com. The animation on the home page is what I want to loop. It plays okay in Safari, has mixed results in Firefox. Not sure yet about IE, I'm on a Mac.
    I'd love to hear ideas to fix this. The workflow is An—>OAM export—>Muse "place"—>Muse publish to ftp.
    Thank you,
    Dan

    I'm having the same problem. I inserted the oam in Dreamweaver, where it loops forever in split and live view. As soon as I view it in a browser (Safari and Chrome), the looping is disabled. There are no console errors.

  • How can I read a specific character from a text file?

    Hi All!
    I would like to read a specific character from a text file, e.g. the 2012th character in a text file with 7034 characters.
    How can I do this?
    Thanks
    Johannes

    just use the skip(long) method of the input stream that reads the text file and skip over the desired number of bytes

  • I would like to get rid of firefox 4 and go back to the older one, how do I do this

    I would like to get rid of firefox 4 its a nuisance and go back to the old one how do I do this

    It's helpful to give more specific feedback if you can.
    Here's the process to roll back:
    First, I recommend backing up your Firefox settings in case something goes wrong. See [https://support.mozilla.com/en-US/kb/Backing+up+your+information Backing up your information] (copy your whole profile folder).
    Next, download and save Firefox 3.6 to your desktop for future installation. http://www.mozilla.com/firefox/all-older
    Close Firefox 4, and uninstall it. Do not remove your personal data and settings, just the program.
    Then finally you can reinstall Firefox 3.6. Unless you have installed an incompatible add-on, it should pick up where you left off. If there are serious issues, please post back with details.
    Note: I haven't actually tried this myself!

  • HT201269 i would like to get my notes back or at least be able to see them, from itunes without restoring my brand new iphone 4s as i believe the back up from my previous iphone is corrupted. Help please

    i would like to get my notes back from itunes or at least be able to see them without restoring my brand new iphone 4s as i believe the back up from my previous iphone is corrupted. Help please

    If you can't restore from your backup you could try 3rd party software such as iPhone Backup Extractor to see if you could extract your notes from the backup.

  • I have an ipad and an iphone.  For the purposes of facetime, I would like to associated my email address with just the ipad and my cell number with just the iphone.  I went to settings facetime on the iphone but it won't let me remove the email address.

    Please see above.  I have both an ipad and and iphoen.  For the purposes of facetime, I would like to associate only my email address with the ipad and only the phone number iwht the iphobne.  However, I cannot remove the email address from the iphone.  So, when I get a facetime via email, it rings on both the iphone and ipad.  Settings>>facetime will not let me remove the email.

    I wouldn't want to say exactly, however I would imagine that it has to do with the fact you use the same Apple ID on both devices. Since Facetime was activated on the phone, with the number, and then activated on the iPad with the email and same Apple ID, they are somehow linked. I'm not sure that you can separate it without having a different Apple ID on the two devices. Otherwise you can look at this support document http://support.apple.com/kb/TS3367 and see if that helps you any.

  • How to download only specific photos from my camera?

    Hi,
    I'm in the habit of not deleting the photo images from my camera's CF card frequently. The problem with using iPhoto is that that it appears to only allow me to download ALL or NOTHING of the photos on my camera. I would like to selectively download specific photos from my camera with iPhoto. Is this possible?
    Thanks.
    mac book pro   Mac OS X (10.4.9)  

    Hello.
    There is also a way to selectively upload directly to iPhoto. If your camera mounts on the desktop as an external drive, simply ignore iPhoto's initial uploading screen. [Click back on Library in the Source Pane if this screen distracts you.] Choose File> Import to Library. A window will open where you can navigate to your camera, preview the images, and select only the ones you wish to upload. As in the Finder, Shift-click will select a contiguous range, and Command-click selects multiple, nonconsecutive items.
    If your camera does not mount on the desktop (most Canons do not) then you can use a card reader. Place the card in the reader, connect to the Mac via USB, and use the above method to upload from the card. This is my preferred method, since it saves on the camera's batteries.
    Cheers.

  • How can I use Automator to extract specific Data from a text file?

    I have several hundred text files that contain a bunch of information. I only need six values from each file and ideally I need them as columns in an excel file.
    How can I use Automator to extract specific Data from the text files and either create a new text file or excel file with the info? I have looked all over but can't find a solution. If anyone could please help I would be eternally grateful!!! If there is another, better solution than automator, please let me know!
    Example of File Contents:
    Link Time =
    DD/MMM/YYYY
    Random
    Text
    161 179
    bytes of CODE    memory (+                68 range fill )
    16 789
    bytes of DATA    memory (+    59 absolute )
    1 875
    bytes of XDATA   memory (+ 1 855 absolute )
    90 783
    bytes of FARCODE memory
    What I would like to have as a final file:
    EXCEL COLUMN1
    Column 2
    Column3
    Column4
    Column5
    Column6
    MM/DD/YYYY
    filename1
    161179
    16789
    1875
    90783
    MM/DD/YYYY
    filename2
    xxxxxx
    xxxxx
    xxxx
    xxxxx
    MM/DD/YYYY
    filename3
    xxxxxx
    xxxxx
    xxxx
    xxxxx
    Is this possible? I can't imagine having to go through each and every file one by one. Please help!!!

    Hello
    You may try the following AppleScript script. It will ask you to choose a root folder where to start searching for *.map files and then create a CSV file named "out.csv" on desktop which you may import to Excel.
    set f to (choose folder with prompt "Choose the root folder to start searching")'s POSIX path
    if f ends with "/" then set f to f's text 1 thru -2
    do shell script "/usr/bin/perl -CSDA -w <<'EOF' - " & f's quoted form & " > ~/Desktop/out.csv
    use strict;
    use open IN => ':crlf';
    chdir $ARGV[0] or die qq($!);
    local $/ = qq(\\0);
    my @ff = map {chomp; $_} qx(find . -type f -iname '*.map' -print0);
    local $/ = qq(\\n);
    #     CSV spec
    #     - record separator is CRLF
    #     - field separator is comma
    #     - every field is quoted
    #     - text encoding is UTF-8
    local $\\ = qq(\\015\\012);    # CRLF
    local $, = qq(,);            # COMMA
    # print column header row
    my @dd = ('column 1', 'column 2', 'column 3', 'column 4', 'column 5', 'column 6');
    print map { s/\"/\"\"/og; qq(\").$_.qq(\"); } @dd;
    # print data row per each file
    while (@ff) {
        my $f = shift @ff;    # file path
        if ( ! open(IN, '<', $f) ) {
            warn qq(Failed to open $f: $!);
            next;
        $f =~ s%^.*/%%og;    # file name
        @dd = ('', $f, '', '', '', '');
        while (<IN>) {
            chomp;
            $dd[0] = \"$2/$1/$3\" if m%Link Time\\s+=\\s+([0-9]{2})/([0-9]{2})/([0-9]{4})%o;
            ($dd[2] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of CODE\\s/o;
            ($dd[3] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of DATA\\s/o;
            ($dd[4] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of XDATA\\s/o;
            ($dd[5] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of FARCODE\\s/o;
            last unless grep { /^$/ } @dd;
        close IN;
        print map { s/\"/\"\"/og; qq(\").$_.qq(\"); } @dd;
    EOF
    Hope this may help,
    H

Maybe you are looking for

  • Read dimension member(master data) to ABAP internal table  in BPC 10.0 NW

    Hi all, I manage to read transaction data using this example [replacement for IF_UJ_MODEL~GET_APPL_DATA; I am now trying to read members(master data) from a dimension to a ABAP internal table but I have no idea how to. Can anyone advise me on how to

  • Windows 7 startup error after uninstall of Photosmart 6510

    After uninstalling Photosmart 6510 and software, get error message: "There was a problem starting C:\Program Files\HP\HP Photosmart 6510 series\bin\HPStatusBL.dll" when Windows 7 starts up.

  • Photo Sharing - Download Size?

    May I first say what a great upgrade this has been... I know from reading other comments that it hasn't been the same for everyone but it was very simple to get my site updated and be working apart from one thing... here is my problem. I've made a lo

  • Recurring Documents run schdule configuration

    Dear all, I have a question regarding the recurring document run schdule configuration. my example is below I received an insurance policy, Period :23.02.2011 - 23.05.2011 (for 3 months) amount: 15.000 USD First I posted this policy to vendor account

  • At selection-screen on radiobutton group is triggering again on execute??

    Hi Friends, I want to show a Information pop up on selection of a radio button for that i have done AT SELECTION-SCREEN ON RADIOBUTTON GROUP RG.   IF P_UPL = 'X'.     CALL FUNCTION 'POPUP_TO_INFORM'       EXPORTING         TITEL = TEXT-017         TX