Need to validate file Name,split the file name and store the splited values into Variables

Dear All,
Below is the my requirement.
I have a folder, in that folder I have bunch of text files. The file name is below format
ACA_122_pay_20140430_001
Initially the file name start with ACA code,groupid,group name and date time stamp. This is the standard structure of file name.
I want to check each and every file in the folder with this structure. The structure should be standard for all the files. If the structure same for all files I need to get codes form file name. For example
If you see the below file name, I need to get ACA and put into variable,I need to get 122 and put into variable. For group name and date time needs to put in variable.
If the file format is not valid state then I need to log exception.
Let me know if I am not clear.
Kindly provide the C# code for achieving the above requirement.
As I am new to .net programming. kindly help me.
Thanks in Advance,
Regards,
Madhava Ganji
Madhava Ganji

Hi MadhavaGanji,
I have post how to validate the file name, header row against definition table which stored the file name and column definition. 
Take a look and see if this is helpful.
http://sqlage.blogspot.com/2013/11/ssis-validate-file-header-against.html
http://sqlage.blogspot.com/

Similar Messages

  • When I click on the Start Icon and type the name of a file I am searching for none appear.

    When I click on the Start Icon and type the name of a file I am searching for none appear.
    Using Widows 7

    Are you searching for a file that you downloaded via Firefox?
    If that is the case then you can check the Download Manager (Tools > Downloads) and if that file is listed there then right click that entry and choose > Open Containing Folder. If that entry is grayed then the file is no longer in the original download location and possibly removed by AV software.

  • How to Compare 2 CSV file and store the result to 3rd csv file using PowerShell script?

    I want to do the below task using powershell script only.
    I have 2 csv files and I want to compare those two files and I want to store the comparision result to 3rd csv file. Please look at the follwingsnap:
    This image is csv file only. 
    Could you please any one help me.
    Thanks in advance.
    By
    A Path finder 
    JoSwa
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful"
    Best Online Journal

    Not certain this is what you're after, but this :
    #import the contents of both csv files
    $dbexcel=import-csv c:\dbexcel.csv
    $liveexcel=import-csv C:\liveexcel.csv
    #prepare the output csv and create the headers
    $outputexcel="c:\outputexcel.csv"
    $outputline="Name,Connection Status,Version,DbExcel,LiveExcel"
    $outputline | out-file $outputexcel
    #Loop through each record based on the number of records (assuming equal number in both files)
    for ($i=0; $i -le $dbexcel.Length-1;$i++)
    # Assign the yes / null values to equal the word equivalent
    if ($dbexcel.isavail[$i] -eq "yes") {$dbavail="Available"} else {$dbavail="Unavailable"}
    if ($liveexcel.isavail[$i] -eq "yes") {$liveavail="Available"} else {$liveavail="Unavailable"}
    #create the live of csv content from the two input csv files
    $outputline=$dbexcel.name[$i] + "," + $liveexcel.'connection status'[$i] + "," + $dbexcel.version[$i] + "," + $dbavail + "," + $liveavail
    #output that line to the csv file
    $outputline | out-file $outputexcel -Append
    should do what you're looking for, or give you enough to edit it to your exact need.
    I've assumed that the dbexcel.csv and liveexcel.csv files live in the root of c:\ for this, that they include the header information, and that the outputexcel.csv file will be saved to the same place (including headers).

  • How can I do to acquire and save date in the same time and in the same file when I run continual my VI without interrupti​on.

    I've attached a VI that I am using to acquire amplitude from Spectrum analyzerse. I tried to connect amplitude ouput to the VI Write Characters To File.vi and Write to Spreadsheet File.vi. Unfortunately when I run continual this VI without interruption, labview ask me many time to enter a new file name to save a new value.
    So, How can I do to aquire and save date in the same time and in the same file when I run continual my VI for example during 10 min.
    Thank you in advance.
    Regards,
    Attachments:
    HP8563E_Query_Amplitude.vi ‏37 KB

    Hi,
    Your VI does work perfectly. Unfortunately this not what I want to do. I've made error in my last comment. I am so sorry for this.
    So I explain to you again what I want to do exactly. I want to acquire amplitude along road by my vehicle. I want to use wheel signal coming from vehicle to measure distance along road. Then I acquire 1 amplitude each 60 inches from spectrum analyzer.
    I acquire from PC parallel port a coded wheel signal coming from vehicle (each period of the signal corresponds to 12 Inches). Figure attached shows the numeric signal coming from vehicle, and the corresponding values “120” and “88” that I can read from In Port vi.
    So I want to acquire 1 time amplitude from spectrum analyser each 5
    period of the signal that I am acquiring from parallel port.
    So fist I have to find how can I count the number of period from reading the values “120” and “88” that I am acquiring from In Port (I don’t know the way to count a number of period from reading values “120” and “88”).
    Here is a new algorithm.
    1) i=0 (counter: number of period)
    2) I read value from In Port
    3) If I acquire a period
    i= i+1 (another period)
    4) If i is multiple of 5 (If I read 5 period)
    acquire 1 time amplitude and write to the same
    file this amplitude and the corresponding distance
    Distance = 12*i). Remember each period of signal
    Corresponds to 12 Inches).i has to take these
    values: 5,10,15,20,25,35,40,45,50,55,60............
    5) Back to 2 if not stop.
    Thank you very much for helping me.
    Regards,
    Attachments:
    Acquire_Amplitude_00.vi ‏59 KB
    Figure_Algorithm.doc ‏26 KB

  • I accidently deleated file from the Elements organizor and from the hard drive. Can I get it back?

    I accidently deleated a file from the Elements organizor and from the hard drive. Can I get it back? How to do it?

    There's a good chance that you can if you haven't done too much work after deleting it.  Typically files are not actually wiped from the hard drive, rather the space they take is marked as free to use by another file if needed.  So if it hasn't been used by another file it can be recovered.
    Try this program...  it will help if you know where the images were stored.
    http://www.piriform.com/recuva
    Colin

  • Export data in CSV and store the file in local drive

    Hi,
    Here is the requirements.
    Fetch the values from table (around 60000 records), and export them into CSV file and store the file in local drive.
    I have written servlet to to this and it is working fine expect saving the file in local drive. At the moment, it is asking to save as in local drive. i want to save the file automatically in particular path (/var/www/files/). Below is the code.
    String file = "CandidatesDetails" + sd + ".csv";
                        queryString = "select * from candidate where candidate.status='A'";
                        connection = ConnectionPoolHelper.getConnection();
                        response.setContentType("application/csv");
                        response.setHeader("content-disposition", "filename=" + file);
                        System.out.println("Query= " + queryString);
                        ps = connection.prepareStatement(queryString,
                                  ResultSet.TYPE_SCROLL_INSENSITIVE,
                                  ResultSet.CONCUR_READ_ONLY);
                        rs = ps.executeQuery();
                        datas = "CANDIDATE ID,CANDIDATE TITLE,FIRST NAME,LAST NAME,E-MAIL,NATIONALITY ID,NATIONALITY,COUNTRY ID,COUNTRY NAME,INDUSTRY ID,INDUSTRY DESCRIPTION,EXPERIENCE,DATE OF BIRTH,HEAR ABOUT US\n";
                        oout.write(datas);
                        String country = "";
                        String nationality = "";
                        String hearABtUs = "";
                        while (rs.next()) {
                             nationality = rs.getString(7);
                             if (nationality == null)
                                  nationality = "";
                             else if (nationality.equals("null"))
                                  nationality = "";
                             country = rs.getString(9);
                             if (country == null)
                                  country = "";
                             else if (country.equals("null"))
                                  country = "";
                             hearABtUs = rs.getString(14);
                             if (hearABtUs == null)
                                  hearABtUs = "";
                             else if (hearABtUs.equals("null"))
                                  hearABtUs = "";
                             else
                                  hearABtUs = hearABtUs.replaceAll(",", ";");
                             datas = rs.getInt(1) + "," + rs.getString(2) + ","
                                       + rs.getString(3) + "," + rs.getString(4) + ","
                                       + rs.getString(5) + "," + rs.getInt(6) + ","
                                       + nationality + "," + rs.getInt(8) + "," + country
                                       + "," + rs.getInt(10) + "," + rs.getString(11)
                                       + "," + rs.getString(12) + "," + rs.getString(13)
                                       + "," + hearABtUs + "\n";
                             oout.write(datas); Regards,
    Dongan.

    Here is the first few lines
    public void doGet(HttpServletRequest request, HttpServletResponse response)
                   throws ServletException, IOException {
              HttpSession session = request.getSession(true);
              String datas = "";
              PreparedStatement ps = null;
              ResultSet rs = null;
              String queryString = "";
              Connection connection;
              PrintWriter oout = response.getWriter();
              java.util.Date d = new java.util.Date();
              SimpleDateFormat dateformat = new SimpleDateFormat("dd-MMM-yyyy");
              String sd = dateformat.format(d);
              tryAt the moment, when i run http://localhost:8080/project/CandidatesDetail, it will ask me to save the file somewhere. I should manually mention the path to save the file. what i want is, it should automatically save it in the location C:\projects\files\.
    thanks.
    Regards,
    Dongan
    Edited by: Dongan on Oct 26, 2007 5:22 AM

  • How do I set the HELP menu to use Indesign's local HELP files on the hard drive and not the web?

    How do I set the HELP menu to use Indesign's local HELP files on the hard drive and not the web?
    CS 5.0 launches the internet browser.  > TO SLOW I DONT WANT THIS.
    CS 3.0 uses the local help files > I WANT THIS FOR 5.0.

    You're not speaking to the right forum for your request. Help is a Suite-wide feature and here is the forum where the Help application is discussed, and where the proper Adobe people hang out:
    Community Help Application

  • I have LR 5.  When I'm in the book module and select the option to "Send Book to Blurb" i get an error message saying "The file does not have a program associated with it...."  How do I fix this?

    I have LR 5.  When I'm in the book module and select the option to "Send Book to Blurb" i get an error message saying "The file does not have a program associated with it for performing this action.  Please install a program, or if one is already installed, create an association in the Default Programs control panel."
    How do I fix this?

    Try the following user tip:
    "There is a problem with this Windows Installer package ..." error messages when installing iTunes for Windows

  • Windows vista system, continuously trying to download a DRM file in Adobe Digital Editions application shows "Error check activation". I have authorized the Fire Wall and still the same.

    windows vista system, continuously trying to download a DRM file in Adobe Digital Editions application shows "Error check activation". I have authorized the Fire Wall and still the same.

    Since Re-activation as suggested by the link above is not working for you, Can you please confirm the following:
    The OperatorURL is reachable. ( you can find the operatorURL from the acsm file by opening it in notepad,etc)
    And Book is still available on the book-store for purchase.
    (If any of first two are not available, you might have to talk to distributor for next action item to get the book. Since you will have record of purchasing the book, (in my opinion) they should provide you the new token for downloading the book)
    And please confirm this that you used the same userID for downloading that you used when you first fulfilled/downloaded the book.
    (If it is the case, then you have to use the correct userID)
    I hope it helps.

  • When copying Itunes to an external drive, how do I get iTunes to feed from the file on the external drive and not the computer/

    I've already copied my iTunes folder onto my external hardrive. I'm having problems getting iTunes to pull the information from the external hardrive and not the computer's internal one, though. Any suggestions on how to get it to work?

    iTunes works off of an ITL file in the iTunes folder
    instead of dragging the folder out of the external hardrive and onto the desktop just do this
    -hold shift key and double click iTunes to open it up
    -you will get a prompt asking to create a new library or choose library, click choose library
    -an explorer window will open up and you are going to navigate to the external hard drive and open the iTunes folder
    -in the iTunes folder you are going to find a file that doesn't look like a folder but a page with a corner folded on it that is your iTunes library file
    -double click the iTunes library file and your library will appear and you are good to go
    WARNING: this is a good method for making sure your music doesn't take all of your computer's storage but keep in mind if you remove the external hard drive from the computer you may have issues accessing the library example next to the song titles

  • I have a mid 2007 iMac.    2 GHz Intel Core 2 Duo, 4 GB 667MHz DDR2 SDRAM, OSX 10.9.5.   I attempted to do the latest update and got the message:  Start up disk is full.  Delete files.  How do I do that?

    I have a mid 2007 iMac.    2 GHz Intel Core 2 Duo, 4 GB 667MHz DDR2 SDRAM, OSX 10.9.5.   I attempted to do the latest update and got the message:  Start up disk is full.  Delete files.  How do I do that?

    Freeing Up Space on The Hard Drive
      1. See Lion/Mountain Lion/Mavericks' Storage Display.
      2. You can remove data from your Home folder except for the /Home/Library/ folder.
      3. Visit The XLab FAQs and read the FAQ on freeing up space on your hard drive.
      4. Get an external hard drive on which to store some of your files after which you can
          erase the data from your internal drive to free up space.
      5. Also see Freeing space on your Mac OS X startup disk.
      6. See Where did my Disk Space go?.
      7. See The Storage Display.
    You must Empty the Trash in order to recover the space they occupied on the hard drive.
    You should consider replacing the drive with a larger one. Check out OWC for drives, tutorials, and toolkits.
    Try using OmniDiskSweeper 1.8 or GrandPerspective to search your drive for large files and where they are located.

  • I have downloaded a music file through a downloader . But the file is not found in the captured in music player . How can I locate the physical location and move the file . I cannot do via itunes also .

    I have downloaded a music file through a downloader . But the file is not found in the captured in music player . How can I locate the physical location and move the file . I cannot do via itunes also .

    Exactly what do you mean by a 'downloader'?
    Thanks
    Pete

  • Can i get the time capsule to automatically back up my file from my Mac Book Air but have certain files which are only stored on the time capsule and not the computer? Then can i access these files only on the time capsule without connecting it?

    Can i get the time capsule to automatically back up my file from my Mac Book Air but have certain files which are only stored on the time capsule and not the computer? Then can i access these files only on the time capsule without connecting it?

    igonneau wrote:
    Can i get the time capsule to automatically back up my file from my Mac Book Air but have certain files which are only stored on the time capsule and not the computer?
    You can, but how are you going to back up those other files?  When (not if) your Time Capsule fails, you risk losing them.  See #Q3 in Using Time Machine with a Time Capsule for details.
    Then can i access these files only on the time capsule without connecting it?
    Not sure what you mean.  You have to connect a computer, either via Ethernet cable or wirelessly, to read or write to the disk. 

  • When opening the Coloursync utility and pressing the verify button, I received an error message stating that the Tag 'cprt':Text tag has an incorrect length which could not be fixed as the file is locked. Does anyone know how to rectify this?

    When opening the Coloursync utility and pressing the verify button, I received an error message (copy below) stating that the Tag 'cprt':Text tag has an incorrect length which could not be fixed as the file is locked. Does anyone know how to rectify this?
    Checking 25 profiles...
    /Library/ColorSync/Profiles/Displays/iMac-00000610-0000-9C6C-0000-000004271B00.i cc
       Tag 'cprt': Text tag has an incorrect length.
       The file is locked. Could not be fixed.

    Hi guys,
    I followed the steps to unlock the .icc file in the "getinfo" screen then went on clicking repair in colorsync utility.
    This is the message i got:
    Searching for profiles...
    Checking 17 profiles...
    /Library/ColorSync/Profiles/Displays/Color LCD-00000610-0000-9CF3-0000-000004273CC0.icc
       Tag 'cprt': Text tag has an incorrect length. Fixed.
    Repair done - 1 profiles fixed.
    However, when i hit verify again it shows up like this:
    Searching for profiles...
    Checking 17 profiles...
    /Library/ColorSync/Profiles/Displays/Color LCD-00000610-0000-9CF3-0000-000004273CC0.icc
       Tag 'cprt': Text tag has an incorrect length.
    Verify done - found 1 bad profile.
    ... and it keeps like this sine die.
    when i open the .icc file it shows up like this:
    3     'cprt'     'text'     35     Copyright ASCII Text String
    New to mac so I really don't know what to do.
    I didn't get this message so far. What i did before getting this message was to open a jpeg file. I wanted to edit it so when i did right click on the file i went to open with, and colorsync came as an option; so i chose it.
    Then this message started comming up.
    Is there anything i can do?
    Thabks for the support.

  • I am trying to use the brightness adjustment on a grayscale photoshop CS6 file.  The preview shows the adjustment working and changes the brightness, but when you click to apply the change, it does not apply the adjustment.  I have run into this problem b

    I am trying to use the brightness adjustment on a grayscale photoshop CS6 file.  The preview shows the adjustment working and changes the brightness, but when you click to apply the change, it does not apply the adjustment.  I have run into this problem before, although rarely, with some other files over the years and with earlier versions of CS.  I would like to know how to overcome this problem?

    Make sure you are viewing your image at 100%. At smaller views, pixels and layers and the way they interact are approximate interpolations and won't show you the actual pixel-for-pixel changes.

Maybe you are looking for

  • How can I restrict X11 apps to my primary display?

    The question's in the subject line, but here's why. I have a secondary display attached to my iMac and I find it very useful as a dumping ground for useful ancillary windows and apps. The arrangement of my workspace dictates that the secondary displa

  • Stalled at 3.95ghz w/ X58 Pro

    Hey Guys, I have a X58 Pro motherboard that's currently clocked at 3.95ghz.  I'm real happy with the performance so far, compared to my GA-EX58-UD3R, but I'd like to push it a little farther. As the heading states, I'm stalled at 3.95ghz. If someone

  • Multiple hyperlinks edit in iWeb - new window and format?

    Hello, I'd like to edit a selection of several hyperlinks in iWeb 3.04 but when selected, I am not able to check the "Open in new window" option or the options in the Format panel. Can this be done in iWeb 3.0.4? If not, any suggestions? Thank you

  • Making a JButton react like a JMenu

    Hi everybody, I'm really not sure if this is possible; if it isn't, feel free to tell me. Anyway, I have a JMenuBar with multiple JMenus, interspersed with JButtons. The JButtons replace JMenus with no JMenuItems, so you can just click on them and ha

  • Safari 6 audio control

    Is there a way or an extention to control the audio in Safari 6.x? I'm running a Mac Pro with OS-X 10.8.2. I listen to the radio via an application while using Safari and I hate it when Websites blare music or ads at you when you open the pages, and