Is there a way to check whether an Excel file has a header or not?

Hi!
I'm currently using POI Utility to read and write Excel files.
You normally use the HasHeaderRow = true / false to specify whether the file has a header or not.
Now, let's say I have a program that needs to read Excel files from a directory, some have headers, some don't.
Is there a way to know dynamically whether a header has been defined or not?
Then, for those having headers, the flag will be set as true, while for those which don't have any header, the flag will be set as false.
E.g.
<!--- Create an instance of the POIUtility.cfc. --->
    <cfset objPOI = CreateObject(
        "component",
        "POIUtility"
        ).Init()
        />
<!--- Set directory --->
<cfset currentDirectory = GetDirectoryFromPath(GetTemplatePath()) & "newDir">
<!--- Check whether the directory exists. --->
<cfif DirectoryExists(variables.currentDirectory)>
     <!--- Read files from the specified directory --->
     <cfdirectory action="list" directory="#variables.currentDirectory#" type="file" filter="*.xls" name="qDirectory">
     <!--- Check if the directory has any Excel file --->
     <cfif variables.qDirectory.recordcount gt 0>
          <!--- Loop query --->
     <cfloop query="variables.qDirectory">
               <!--- Check if header is present in each of the file --->
                    IF headerExists THEN
                         headerFlag = true
                    ELSE
                         headerFlag = false
                    END IF
               <!--- Read Excel File --->
            <cfset objSheet = objPOI.ReadExcel(FilePath = #variables.qDirectory.name#, HasHeaderRow = #variables.headerFlag#, SheetIndex = 0) />
          </cfloop>
     </cfif>
</cfif>
Any help would be most welcome.
Thanks and regards,
Yogesh Mahadnac  

Hi cfSearching,
Many thanks for your reply! I really do appreciate!
However, I've still got 1 more question for you.
At the moment, I'm using POI and sometimes cfx_Excel2Query to read Excel files.
In both cases, you have to specify whether the first row is a header.
How would you read the Excel file to check whether the 1st row is the header?
I've tried using cffile, but I get all sorts of "garbage"
        <cffile action="read" file="#variables.filename#" variable="xlsResult">
        <cfloop index="i" list="#variables.xlsResult#" delimiters="#chr(13)#&#chr(10)#">
            <cfif variables.i eq 1>
                <cfoutput>
                    Test 1st Row: #trim(replacenocase(listgetat(variables.i,1,","),'"',"","All"))#
                </cfoutput>
            </cfif>
        </cfloop>
I get the following output:
ÐÏ à¡± á����.... etc etc
I'd be very much grateful if you could please advise on the latter at your earliest convenience.
Thanks and best regards,
Yogesh Mahadnac

Similar Messages

  • Is there any way to check out if my iphone has been hack?

    is there any way to check out if my iphone has been hack?

    Restore it in iTunes,
    Backing Up, updating, and restoring your iPhone and iPod touch software

  • I am using Outlook 2010 and have a iphone 4s.  In Outlook I have issues with my contacts not being the same as what I have corrected them to be.  Is there a way to check and see which file Outlook is sharing with I-cloud?

    I am using Outlook 2010 and I also use a Iphone 4s. I use Outlook to correct all my contacts and them it sync with my phone BUT I get different variations of the contacts.  Almost as if there is another file it is going to.  Can I check to see which file it is reading from??

    This may be helpful.
    http://itconflict.com/2012/01/08/troubleshooting-icloud-sync-with-outlook/

  • How to check whether java.sql.Connection has been dropped or not

    Hi,
    How can i check whether the connection is dropped from the database or not by using java.sql.Connection API.
    Thanks

    There's a few ways to check Connections, each with a different use:
    (1) conn.isOpen()
    (2) conn == null
    (3) the last one is a little more involved and adds some overhead. You can run SELECT 1 FROM dual; (Oracle) or SELECT 1 (MSSQL) and check for exceptions.
    The only way to check a connection, as far as I know, is to use it. That said, there must be a better way???

  • Is there any way to call a sub vi which has input parameters and not wait until it finishes executing?

    Hi,
    I have a main vi that I would like to call a sub vi from and have the main vi continue on without waiting for the sub vi to finish. I can open a reference to the sub vi and invoke the "run" method, but in this fashion, I cannot pass any parameters to the sub vi. Or, I can use a call by reference node where I can pass parameters, but there is no option to not "wait until done". How can I do this? Is global variables the only way?
    Thanks!

    Use the method Set Control Value before you invoke Run. You specify the exact name of the control and the data you want to pass needs to be flattened to a string.

  • Is there a way to check if I have either deleted a necessary file or...

    Firstly, let me apologize for this rather long post. I just want to make sure I give as much detail in order to get the problem really solved...
    I have a MacBook Pro 2GHz Intel Core Duo with 512 MB of ram. I am running OS 10.4.10 and don't have the means to either upgrade the OS, increase ram or even backup and reinstall (I am in a remote part of the South Pac. Islands, working as a relief worker, without much more than a dish to connect to the net).
    Now while I know that QuickTime has nothing to do with WMA files and that Flip4mac is the solution of record, allow me to pose my problem (because I can't get a straight answer on other forums whose only suggestion is to reinstall their software).
    I have been using Flip4Mac QuickTime components successfully (to save radio streams) for over a year without a single problem with various versions of Quicktime. Presently, i use QuickTime version 7.6.0 and all was working fine until a few weeks ago. QuickTime works fine in every other way with the exception of playing my saved streams that contain WMA audio.
    I believe I might have created the problem by either... ignorantly deleting files with a tool that allows me to examine the hard drive (including system files) in order to delete large ""unnecessary"" files... or even possibly, it occurred when questionable-content was auto-opened via QuickTime (which incidentally had caused the system to crash requiring a hard keyboard shutdown and restart). The problem occurred soon thereafter.
    i have un-installed and re-installed QuickTime, Flip4Mac and even Windows Media Player for Mac several times with no change. i also ran several virus / disk scans (VirusBarrier, ClamXAV, MacScan, as well as TechTool, Mac HelpMate and MainMenu) also with no change.
    The dialog box that pops up when I attempt to open ANY past saved QuickTime files basically says, QuickTime Player is 'missing a component.' This window doesn't always popup. Also the player will advance the minutes and seconds without playing a sound. Further any app that relies on WMA files also crashes, quits or just doesn't work. Such as WMA to MP3 converters. I even have problems with sounds / music from a couple of MacGames that I own (Luxor & Hidden Relics) as these games may rely on WMA to function (this may or may not be related).
    My question is... is there a way to check if I have deleted a necessary codec, system file, pref. file, receipt, etc. that is crucial to using WMA?
    Or even is there a way to check if some erroneous file has been added to my system (such as a DRM plugin) that is preventing the playing of my saved streams?
    Once again, as I mentioned above, I am unable to backup and reinstall OSX and am at the end of my rope. The only thing that is left for me to say is.... Heeeellllppp!
    Message was edited by: C. Angel

    Tap on the URL to get to edit mode.
    Then slide your finger over the URL to the right until you see the http or https part.
    Or copy the URL and paste it into free Notes page.
    For https URLs there is a padlock in the status bar above the URL.
    If you believe that this sounds complicated, then I agree.
    Perhaps someone will chime in with an easier solution...

  • Is there a way to check if my music(s) can actually play?

    Hello everyone. I'm planning to buy an iPod Shuffle.
    This question will decide if I'll buy the iPod Shuffle or wait for iPod nano.
    My firend who own the iPod shuffle said there's a case when certain .mp3, which is a supported file type, just won't play due to many possible reasons.(like encoder, etc.)
    I know that the problem can be solved by letting iTunes convert the files into its preferred format, then that converted files should be able to play on the iPod shuffle.
    I have no problem with that case if I'm ripping musics from a CD AUDIO. But if the file I want is already a compressed format like MP3, I wouldn't want to lower its quality even further by converting it to AAC or any other compressed format.
    When there are hundreds of music files onto the iPod shuffle, and if 2 or 3 of them will never play, you never know since there's no LCD or browsing features. To check hundreds music file by playing them one-by-one in order is a pain.
    But let me state this I do like the iPod Shuffle more than iPod nano. If there's a way to check if EVERY music files in my iPod are playable, I'll choose iPod Shuffle over iPod nano.
    To sum up the question : Is there a way to check if every music files in the iPod shuffle can actually play?
    Thank you very much. ^_^

    The shuffle will load from a specified play list in the order of that play list if you set it not to choose randomly.
    You do not have to play the songs all the way through to test them. If a song starts you can skip to the next one and test it.
    You have to test the songs on the shuffle becuse usually the songs will play in iTunes and on other iPods. The only shortcuts I have found are:
    1. If one song from an album will not play then all will not play (this is music store purchases) Thus you can test one song instead of an entire album.Ooops CD - i think I just dated myself.
    2. I have only had problems with songs from the Music Store. YMMV A very small number of songs.

  • Is there any other ways to check whether is my phone faulty or my sim card issue. I can only use it for call, my network to 3G or 4G suddenly cannot use.

    Is there any other ways to check whether is my phone faulty or my sim card issue. I can only use it for call, my network to 3G or 4G suddenly cannot use. This happen since yesterday, suddenly can use but suddenly cut off. Called Telco and they reset account but still same.

    See this
    http://support.apple.com/kb/TS4148

  • Is there any way to check on my own internet usage?

    I am really puzzled by my new satellite internet provider (Exede). I joine on 2/14 and by 2/16 they said I had exceeded (pun intended) my 10 gig monthly limit. I know I had not, so when I contacted them and had them check their details, they had my down for 4 gigs both that Sat (15th) and Sunday (16th) between 4PM and 9PM.
         a. I was not even near my iMac between 4:30 and 6:30, and was watching the olympics from7:30.
         b. I had not sent more than 5-6 emails, had not downloaded any videos, movies, etc.
         c. Their tech person said it was really strange even from their viewpoint, but could do little. He did give a super bonus (for free!) of two more gigs - never to be done again.
         d. Their tech person said they had complete confidence in their records and also believed something very strange was going on - like someone else or some virus was using my iMac. I live in a very rural area - thus the satellite connection try. I don't have any neighbors who use my wi-fi.
         e. Does the iMac send constant data on its own? Could it be possible for a virus or some other program to be doing such strange, unauthorized activity? Is there a way to check what acutally went on two days ago?
         f. His only other solution is to unplug their modem when I am not using the computer. Sigh.
    Today I rechecked my use of the 2 gigs of bonus they gave me. I have carefully monitored my usage.
    a. Yesterday I sent 9 emails, got about 20; watched about 5 minutes of a youtube video; and sent a 4.7 imovie enclosure via email. Their recorded me as using 5 gigs!!
    b. Today (it is still am when I write this), I checked my email - 20+ emails, sent 10 (no enclosures) and watched exactly 4:30 minutes of Fcebook videos. Exede added 2 more gigs!!
    I cannot figure out how this is happening. I guess I will have to cancel the service with only a week of being a user - unless someone can help me find the mysterious culprit, be it an unknown meighbor, a mysterious code in my iMac or ???

    Any client on a network, including wireless clients you don't know about, could be consuming bandwidth. Wi-Fi networks must be protected with WPA2 security. If yours isn't, change the security setting on the access point. If it's already set that way, change the password. Make it a string of at least 8 random characters, including digits and upper- and lower-case letters. The password is saved in the keychain and you don't have to be able remember it; in fact, you shouldn't be able to remember it.
    You make these changes in AirPort Utility, if the access point is an Apple device, or in a web browser otherwise.
    If the network or the password was insecure, and bandwidth use returns to normal after securing it, you can be pretty sure the problem was caused by intruders.
    But intrusion may not be the issue. Most often BitTorrent, iCloud, Dropbox, or some other cloud-data application is involved in cases of mysterious bandwidth use by a Mac. If you use iCloud, uncheck at least Photo Stream and Documents & Data in its preference pane and see whether there's any change. If you use third-party network backup or file-sync software, disable that. If you use a torrent client, remove it.
    Otherwise, if you're running OS X 10.9 or later, you can see which processes are most active on the network.
    Launch the Activity Monitor application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)  
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Activity Monitor in the icon grid.
    Select All Processes from the View menu, if not already selected, and also select the Network tab.
    Click the heading of the Sent Bytes column in the process table to sort the entries by bandwidth usage. You may have to click it twice to get the highest value at the top. What is it, and what is the process? Repeat with the Rcvd Bytes column.

  • Is there a way to check FF as BOTH webroot security and now my bank sent a security notification that my Firefox is not secure and may be redirecting elsewhere.

    "ACTIVE PROCESS HAS A POSSIBLE MEMORY LEAK firefox.exe"
    When I run a system analyzer for WEBROOT the results state that there is a security breach for my Firefox browser.
    When I went to access my bank info I receive a message that Firefox is redirecting to a site with a bad certificate.
    Is there a way to CHECK to see if I have a secure copy of Firefox? (Yes, I did install through the main site.
    I TEACH technology for the public school system and have top security which updates regularly and my pc itself runs regular maintenance as well.

    Are there any unknown addons, and do a malware check with some different programs, unless Webroot is bashing firefox over a memory leak it had 2 years ago.
    * [http://www.microsoft.com/security/scanner/default.aspx Microsoft Safety Scanner]
    * [http://www.malwarebytes.org/products/malwarebytes_free/ MalwareBytes' Anti-Malware]
    * [http://support.kaspersky.com/faq/?qid=208283363 TDSSKiller - AntiRootkit Utility]
    * [http://www.surfright.nl/en/hitmanpro/ Hitman Pro]
    * [http://www.eset.com/us/online-scanner/ ESET Online Scanner]

  • Is there any tool to check whether the proper data is inserting or not?

    Hi,
    We have different products A,B and C.
    whenever user crates an account under these products some X,Y,Z table gets updated.
    If user1 creates an account under A then X, Y, Z tables update with some data along with some ID
    If user2 creates an account under A then X, Y, Z tables update with SAME DATA along with some other ID
    Is there any tool to check whether the proper data is inserting (same data is inserting every time) or not?
    p.s : if this thread is not related to this forum .. where can I post?
    Thanks,
    Praveen

    Is there any tool to check whether the proper data is inserting (same data is inserting every time) or not?You need to check the code to see that. Is the update or insert on the table has from different places? In that case it would be better to have them moved to a centralized place may be a package.
    If you want to restrict the columns to specific values then you can use constraints.

  • Is there a way to check what I had purchased from the itune store to match the charges on my credit card, because there is a charge that I do not recognize

    Is there a way to check what I had purchased from the itune store to match the charges on my credit card, because there is a charge that I do not recognize

    http://support.apple.com/kb/HT2727
    Regards.

  • Is there a way to check if the rechargeable battery is the original?  I have a feeling mine has been swapped out...

    I have a feeling my rechargeable battery pack was secretly swapped out by another user (whose battery had died) - left for vacation working computer, returned from vacation battery not charging.  Is there any way to check (serial number, etc.) what battery came with the purchased computer?  Any help would be appreciated.

    kimberlyfrompennington wrote:
    Is there any way to check (serial number, etc.) what battery came with the purchased computer?
    No, but you could check to see if the battery installed has about the same amount of charge cycles if you were paying attention to that number. 

  • HT4859 How can I verify that my App data is actually stored in iCloud. With Dropbox, I can actually see my stored files. With iCloud, itseems I'm supposed 2 just trust that Appl has the data. Short of doing a restore is there no way to check the data?

    How can I verify that my App data is actually stored in the iCloud. I can see and access my notebook, contacts etc. on the iCloud website, and I can see my photos in a folder on my Windows-based desktop compter (iCloud/Photostream). But no app data.
    With Dropbox, I can actually see all of my stored files. With iCloud, it seems, I'm supposed to just trust that Apple has my back. Short of deliberately trashing my app data and then attempting a restore, is there no way to check the data?

    You can't access them on Windows (unless you have iCloud enabled Windows programs) and I don't think any are, yet.
    iCloud data is accessed via Apps/Programs, the Windows programs vendors will have to step up (just to make it worse Microsoft have not yet enabled their Mac programs, such as Office yet) I doubt that iCloud access is much of a priority for them, complain to MS, when enough Windows users complain maybe they'll do something.

  • Is there any way to check rc.conf without restarting the machine?

    Hi everybody,
    I've VPS running with Arch. It was preinstalled with very, very old versiol so I've upgraded everything, updated rc.conf by hand but still never restarted completely. So my question is - is there any way to check that the server will boot up without issues? Is there any way to check that rc.conf is completely valid?

    peets, thanks! It seems to be ok at this point.
    tomk, understood... Well, I'll paste it here maybe somebody could look throught for some possible incompability problems from old version:
    LOCALE="en_US.utf8"
    HARDWARECLOCK="localtime"
    TIMEZONE="Europe/Vilnius"
    KEYMAP="us"
    CONSOLEFONT=
    CONSOLEMAP=
    USECOLOR="yes"
    MOD_AUTOLOAD="yes"
    MOD_BLACKLIST=()
    MODULES=()
    USELVM="no"
    HOSTNAME="server"
    DAEMONS=(syslog-ng network netfs crond sshd nginx mysqld @postfix php-fpm @svnse
    rve @pure-ftpd)
    lo="lo 127.0.0.1"
    INTERFACES=( "lo" "venet0" "venet0_0" )
    venet0="venet0 127.0.0.1 netmask 255.255.255.255 broadcast 0.0.0.0"
    rt_venet0="-net 191.255.255.1 netmask 255.255.255.255 dev venet0"
    rt_default="default gw 191.255.255.1"
    ROUTES=( "rt_venet0" "rt_default" )
    venet0_0="venet0:0 79.98.27.163 netmask 255.255.255.255 broadcast 0.0.0.0"
    The most important is to bring networking up after restart :-) last lines from "lo=..." is from old rc.conf so I'm not sure if this is compatible with newest Arch.
    Thank you for help, guys!
    Last edited by InfernalH (2009-06-13 15:24:37)

Maybe you are looking for

  • HT2513 How can I create a calendar on iCal that shows up separate from my calendar?

    I want to create a new iCalendar for a friend. I have done File --> New Calendar and File --> New Calendar Group but a blank calendar does not appear. My calendar remains on the screen. I click on my Home and Work and then my friend's calendar but my

  • Some of my images do not show up (some do) when I publish a Dreamweaver document

    Here's my problem: I have been working on a web site, using Dreamweaver CS6. Working on a mac with 10.6.8. The site has several pages, and several of these pages have several images each. All the images are jpgs. Some are RGB files, drawn from digita

  • Palm Desktop Will Not Launch In Windows 7

    Well, I may have a new wrinkle in the ongoing saga of Windows 7 - Palm problems.  I just loaded the Palm Desktop program to my Windows 7 32-Bit OS and then I did a Hotsync which according to the Palm Sync Manager went fine.  When I try to launch the

  • HT1937 my ipod is not turning on.. please please help me

    hey.. my ipod nano is not turning on as it is fully charged.. and there is also a bigger probelm that my charger is broken..  so please help me.. please please..

  • SAP PM or MM Which will be better

    Hello Everyone. I m Yash From Guj. I had done B.E.(I.T.) And workign in IT industry as a Software engg. I want to do SAP ,My programming level is not so good so in Technical I choose either BI/ Basis.. But i heard in BI does not have a lot opening an


HashFlare