Find no of rows in a particular file

Hi
Can any1 tell me if i m trying to read a file through java code,how can i get the no of rows in a particular file

Assuming the lines are not all the sme length, and you haven't placed any header information in the file to tell you where the lines start, you use a BufferedReader to read each line in a loop, and you increment a counter each tie through that loop.
http://java.sun.com/docs/books/tutorial/essential/io/index.html

Similar Messages

  • Find out duplicate rows in a flat file before using sqlldr

    Hello i want to import via sqlldr from a flat file to a table inside my data base. My flat file has unfortunately some duplicate copies inside. So, i defined my upload table with two primary keys- date and time(and sometimes there are more than one row with the same time and date inside the flat file). These primaries are important to me because i want to use them for later tables and i can't use the direct path and parallel method by using primaries.
    Is there any tool which can find duplicate copies before i use sqlldr. But, the special case here is, that the rows not really duplicated but date and time rows twice. And for my interest it isn't necessary whether there are different values in the second row of the same date and time. The file contains data which is monitored every second and that's enough.
    It would be nice if someone could help me
    cheers

    I simply upload from sqlldr to staging tables first.
    The staging tables allow duplicates then I do what I need to do in regards to duplicates or missing data during the transfer from the staging tables to the real tables.
    The staging tables are also global temporary tables so I don't have to worry about cleaning them up or multiple sessions trampling each other.
    I have also used an external table on the datafile instead of sqlldr, this allows me to get rid of the staging table. But that is only good for very small datasets in the file being loaded.

  • Hard to find particular file in cache of firefox 8.0.1, there are two many folders.

    I am a ubuntu 10.10 user. I am regular user of firefox. I was using 3.6.18 since 1 year. Now i am using upgraded version 8.0.1 but I am facing a problem. i am not able to find any particular file in cache of firefox 8.0.1. There are so many folders so its not easy to find file in cache. Please suggest me better way.

    Use the about:cache page to locate the file.

  • ADF table: How to find out which rows were modified by the user

    Hi,
    I am using ADF table to display data that can be modified by the user (ReadOnly = false in the input text). I need to find out which rows were modified by the user, and only update (persist) those rows in the database.
    Is there an easy way to find out which rows were modified by the user.
    I am NOT particularly concerned with which columns were modified as I would update the entire row (if any data in that row is modified).
    I am using Oracle JDeveloper version 11.1.1.3.
    Thanks,
    Ash K

    Thanks Timo.
    I am using ADF Data Control (which are created from Web Service proxy) to display/update the data.
    In the backing bean, the operation that is invoked at the time persisting data is as follows:
    public void commitOperation {
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("operationA");
    DCIteratorBinding dciter = (DCIteratorBinding)bindings.get("someIterator");
    for(int i=0; i<dciter.getViewObject().getEstimatedRowCount(); i++)
    Row row=dciter.getRowAtRangeIndex(i);
    SomeObject someObject= new SomeObject ();
    someObject.setAttr1(row.getAttribute("Attrbute1").toString());
    someObject.setAttr2(row.getAttribute("Attribute2").toString());
    objectList.add(someObject);
    operationBinding.getParamsMap().put("param1", objectList);
    ResultObject result = (ResultObject) operationBinding.execute();
    Inside the for loop (or any other place in the backing bean), I would like to figure out if the row was modified by the user. Please let me know if how to get that. If ADF provides this automatically, that would be GREAT.
    Thanks,
    Ash K

  • Pages app unexpectedly quit whilst I was in the middle of a document. I can now not open it AT ALL. I find it's not just that particular document that won't open, but any of my Pages docs will not open using the current version of Pages. Any help?

    Pages app unexpectedly quit whilst I was in the middle of a document. I can now not open it AT ALL. I find it's not just that particular document that won't open, but any of my Pages docs will not open using the current version of Pages. The reports of the app unexpectedly closing each time, automatically went to Apple, but I am not sure what happens with them then. Does anyone know how to help me with this? We live in a very isolated region so rely on internet help. Thanks

    I also managed to read a few other discussions about Pages and files not being able to open. I actually went to the last back-up and restored the computer from that and everything seemed to work ok again, which is great!...advice from another discussion I think you may have been involved in PeterB. Thanks for the advice...also this advice, as I will make a note of trying to open using the Shift key if it happens again and see what happens...might be an easier first option than restoring from a back-up. Thans heaps for the help!
    I was interested to read some of the other discussions where it was stated that Pages '09 seems to be a better option to use. I have both installed, so I will lkeep this in mind. Thanks heaps!

  • When i use view as list in finder and open a folder with many files i cant right click with mouse without selecting or highlighting a file....i just want to right click to paste an item or create a new folder...what can i do?

    When i use view as list in finder and open a folder with many files i cant right click with mouse without selecting or highlighting a file....i just want to right click to paste an item or create a new folder...what can i do?

    Thx for that im gonna try it....but is there a way to do it without using toolbar or cmd-c...? i mean using only the mouse?why does it have to highlight the file even though i click a bit next to it....?using icon view i can right click next to the folder and i wont have a problem but with list view that i prefer using it will highlight the whole row.....and i dont find free space to right click cause i got many files

  • Check if external program (MS Excel) is active and has opened a particular file

    All
    I need to find some solution for next problem (Visual Studio 2010). I have a form with some buttons. Those buttons open Excel-files from a network share and the Excel-files are marked as shared (meaning they can be opened/edited by multiple users from different
    computers at same time).
    Anyway, when the user presses the button on the form, the file opens in Excel as expected. If he presses the button again, the file is opened again in a second Excel instance. I want to build in some check: if the file is already opened in an existing Excel
    instance, that instance should become visible.
    That's not all: there is a possibility the user already opened the Excel-file before he launched my application. If he then presses the button, the existing Excel-instance (with this particular file) must be shown.
    Of course, the user can close his Excel file. So if he then presses the button, a new Excel instance should start up which opens the file.
    How can this be done?
    Regards
    Kris

    Hi,
     Here is an example that will find any instances of Excel and check if they have a specified file name opened.  If it is found it will bring the Excel window to the foreground or if it is minimized it will be restored.
    Imports System.Runtime.InteropServices
    Public Class Form1
    <DllImport("user32.dll", EntryPoint:="SetForegroundWindow")> _
    Private Shared Function SetForegroundWindow(ByVal hWnd As IntPtr) As <MarshalAs(UnmanagedType.Bool)> Boolean
    End Function
    <DllImport("user32.dll", EntryPoint:="ShowWindow")> _
    Private Shared Function ShowWindow(ByVal hWnd As IntPtr, ByVal nCmdShow As Integer) As <MarshalAs(UnmanagedType.Bool)> Boolean
    End Function
    <DllImport("user32.dll", EntryPoint:="IsIconic")> _
    Private Shared Function IsIconic(ByVal hWnd As IntPtr) As <MarshalAs(UnmanagedType.Bool)> Boolean
    End Function
    <UnmanagedFunctionPointer(CallingConvention.StdCall)> _
    Private Delegate Function EnumCallBackDelegate(ByVal hwnd As IntPtr, ByVal lParam As IntPtr) As Integer
    <DllImport("user32.dll", EntryPoint:="EnumChildWindows")> _
    Private Shared Function EnumChildWindows(ByVal hWndParent As IntPtr, ByVal lpEnumFunc As EnumCallBackDelegate, ByVal lParam As Integer) As <MarshalAs(UnmanagedType.Bool)> Boolean
    End Function
    <DllImport("user32.dll", EntryPoint:="GetWindowTextW")> _
    Private Shared Function GetWindowTextW(ByVal hWnd As IntPtr, <MarshalAs(UnmanagedType.LPWStr)> ByVal lpString As System.Text.StringBuilder, ByVal nMaxCount As Integer) As Integer
    End Function
    Private Const SW_RESTORE As Integer = &H9
    Private ChildHandles As New List(Of IntPtr)
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    'Check if Excel has "My Excel File.xls" opened
    If Not IsExcelFileOpen("My Excel File.xls") Then
    MessageBox.Show("Excel does not have this file opened.")
    Else
    MessageBox.Show("Ecell has this file opened.")
    End If
    End Sub
    Private Function IsExcelFileOpen(ByVal filename As String) As Boolean
    ChildHandles.Clear()
    For Each p As Process In Process.GetProcessesByName("EXCEL")
    EnumChildWindows(p.MainWindowHandle, AddressOf EnumChildWindowProc, 0)
    For Each h As IntPtr In ChildHandles
    Dim sb As New System.Text.StringBuilder(256)
    GetWindowTextW(h, sb, 256)
    If sb.ToString.ToLower.Contains(filename.ToLower) Then
    If IsIconic(p.MainWindowHandle) Then
    ShowWindow(p.MainWindowHandle, SW_RESTORE)
    Else
    SetForegroundWindow(p.MainWindowHandle)
    End If
    Return True
    End If
    Next
    Next
    Return False
    End Function
    Private Function EnumChildWindowProc(ByVal hwnd As IntPtr, ByVal lParam As IntPtr) As Integer
    ChildHandles.Add(hwnd)
    Return 1
    End Function
    End Class
    If you say it can`t be done then i`ll try it

  • Why won't Front Row recognize DV movie files??

    Hi,
    I've placed several DV movie files in my 'Movies' folder and Front Row doesn't seem to find them. If I save the files as an MOV file, front row sees them instantly, but a) it doubles the file size and b) I shouldn't have to do that.
    The first Intel iMac I had (which was returned for other reasons) saw and played the same files immediately after they were dropped in the folder.
    Does anyone know why this might be happening??Does the recent Front Row software update have something to do with it??
    As always, any help is greatly appreciated!
    -SS

    Hey Rachel,
    I use QuickTime Pro to save them as MOV files. If you want a free solution, I'm pretty sure you'd be able to do it using iMovie. Import the DV file and then export it as an MOV file. There's probably another free program out there that will do it more simply, but I haven't looked into that.
    I think this degrades the quality a little bit though, and we shouldn't have to go to this trouble. The DV files (and any other Quicktime-playable format) should show up in Front Row if placed into your "Movies" folder. At least that's my understanding...
    -SS

  • HOW TO SEARCH THE LOCATION OF A PARTICULAR FILE(say a doc file) IN JAVA

    JAVA CODE FOR FINDING THE LOCATION OF A PARTICULAR FILE(say a doc file)

    Well you can write a recursive/iterative code using methods provided by
    java.io.File class.
    However,there are few customized frameworks coming up which can to job for you please have a look at.
    https://filesearch.dev.java.net/
    else where if you wanna build up your own solution the below POST could be useful.
    http://en.allexperts.com/q/Java-1046/desktop-file-search-1.htm
    or you might go ahead and use source of file search utility where an implementation is provided in the below article
    http://jdj.sys-con.com/read/36412.htm
    Hope this might help :)
    REGARDS,
    RaHuL

  • Yosemite finder crashes with previewig .txt and other files

    Hello,
    under Yosemite  the Finder crashes with previewig .txt and other files.
    Is this just my problem? Help please.
    Thank you very much.
    Regards.

    Launch the Console 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 and start typing the name.
    Step 1
    For this step, the title of the Console window should be All Messages. If it isn't, select
              SYSTEM LOG QUERIES ▹ All Messages
    from the log list on the left. If you don't see that list, select
              View ▹ Show Log List
    from the menu bar at the top of the screen.
    In the top right corner of the Console window, there's a search box labeled Filter. Initially the words "String Matching" are shown in that box. Enter the name of the crashed application or process. For example, if Safari crashed, you would enter "Safari" (without the quotes.)
    Each message in the log begins with the date and time when it was entered. Select the messages from the time of the last crash, if any. Copy them to the Clipboard by pressing the key combination command-C. Paste into a reply to this message by pressing command-V.
    ☞ The log contains a vast amount of information, almost all of which is irrelevant to solving any particular problem. When posting a log extract, be selective. A few dozen lines are almost always more than enough.
    Please don't indiscriminately dump thousands of lines from the log into this discussion.
    Please don't post screenshots of log messages—post the text.
    ☞ Some private information, such as your name, may appear in the log. Anonymize before posting.
    Step 2
    In the Console window, select
              DIAGNOSTIC AND USAGE INFORMATION ▹ User Diagnostic Reports
    (not Diagnostic and Usage Messages) from the log list on the left. There is a disclosure triangle to the left of the list item. If the triangle is pointing to the right, click it so that it points down. You'll see a list of crash reports. The name of each report starts with the name of the process, and ends with ".crash". Select the most recent report related to the process in question. The contents of the report will appear on the right. Use copy and paste to post the entire contents—the text, not a screenshot.
    I know the report is long, maybe several hundred lines. Please post all of it anyway.
    If you don't see any reports listed, but you know there was a crash, you may have chosen Diagnostic and Usage Messages from the log list. Choose DIAGNOSTIC AND USAGE INFORMATION instead.
    In the interest of privacy, I suggest that, before posting, you edit out the “Anonymous UUID,” a long string of letters, numbers, and dashes in the header of the report, if it’s present (it may not be.)
    Please don’t post other kinds of diagnostic report—they're very long and rarely helpful.

  • HT201386 how can I find the Image number of a particular photo in the Photos app included with iPad Air?

    how can I find the Image number of a particular photo in the Photos app included with iPad Air?

    Hello yamacutta,
    Thanks for using Apple Support Communities.
    The Photos app will not show you the actual file name of the photo.  However when you go through the image import process on your computer, you should be able to see both the thumbnail of the photo, as well as the filename of the image.
    Import photos and videos from your iPhone, iPad, or iPod touch to your Mac or Windows PC - Apple Support
    Take care,
    Alex H.

  • My 'downloads' box isn't deleting a particular file.

    My 'downloads' box doesn't seem to clear a particular file. All other files seem to delete but this particular file doesn't go. I tried deleting the temp file, resetting the computer, disk clean up etc but to no avail. When I open up the 'downloads' box, the file is there and it says 'paused' but it doesn't resume either when i try and when I right-click on it, the only option I get is 'cancel' (which doesn't seem to work), 'go to download page', 'copy download link', and 'select all'. Even when I select the file, the 'clear list' button is inactive. Please help!!!
    == This happened ==
    Just once or twice
    == 12/06/10 - between 02:00-02:20

    Hello Randy.
    That is very weird... You may be having a problem with some Firefox add-on that is hindering your Firefox's normal behavior. Have you tried disabling all add-ons (just to check), to see if Firefox goes back to normal?
    Whenever you have a problem with Firefox, whatever it is, you should make sure it's not coming from one of your installed add-ons, be it an extension, a theme or a plugin. To do that easily and cleanly, run Firefox in [http://support.mozilla.com/en-US/kb/Safe+Mode safe mode] and select ''Disable all add-ons''. If the problem disappears, you know it's from an add-on. Disable them all in normal mode, and enable them one at a time until you find the source of the problem. See [http://support.mozilla.com/en-US/kb/Troubleshooting+extensions+and+themes this article] for information about troubleshooting extensions and theme. You can troubleshoot plugins the same way.
    If you want support for one of your add-ons, you'll need to contact its author.

  • Search for all locations of particular file kind/type?

    How if possible can I search to find all locations of a particular file kind/type?  Thank you!

    In the Finder find, select Other... from the criteria popup. Add the System files and Visibility to the menu. You can add those options to the search criteria as necessary.
    If the Finder preference is not already set, set it to search the current folder.

  • How to Finding the Last Row Value in Datagrid?

    Hi Everyone,
    Thanks in Advance.
    I need your help, to find the last row data in Datagrid.
    Actually i am using Datagrid to display my Data in flex. In my data i stored the gender value of employees. So if the last row in my datagrid is "female" i need to be highlight that particular row. So please help me to solve this issue.
    Thanks,
    Charles. J

    datagrid.selectedIndex = datagrid.dataprovider.length;
    ^ something like this will select the last row in the datagrid.
    if you need to check it's value, you might need to cast an object here, based on the index value, and check it's gender value.
    datagrid.selectedIndex = datagrid.dataprovider.length;
    if (datagrid.selectedItem["gender"] == "female") {
    //handle here

  • I am new to mac. just purchaased it 3 weeks ag along with MS office for mac, i notice that all my outlook email are in this finder folder, can i delete these email files from this location? why are they there anyway?

    I am new to mac. just purchaased it 3 weeks ag along with MS office for mac, i notice that all my outlook email are in this finder folder, can i delete these email files from this location? why are they there anyway?

    Cherry63 wrote:
    I am talking about the icon on the docking row, that's the guy with the smily face. When you click on him it brings up a bunch of files of what I seem to have store/created on my Imac. There are hundreds of emails and some other documents. I tried to delete a few of them when I first got the MS office but it did not like that, it said it have to rebuild oulook. Why cant i delete these files? is this Apple version of Window outlook PST files?
    These file extenssions are listed as
    olk14_message or even or ccontact. I wish I could send a screen print but I dont see that on the key board. Maybe I should have stuck with windows..
    Oh the ...olk14_message's.  Do not delete them behind Outlooks back, i.e., from the finder.  Those are the various messages that you sent, received, or deleted in Outlook.  They are indexed by Outlook so if you delete behind Outlook's back Outlook will get confused trying to access those messages.
    You can delete them however using Outlook itself.  In outlook select a mailbox (Drafts, Sent Items, Deleted Items, etc.) by clicking on the mailbox on the left.  It will show you the messages in that mailbox.  You can now select all or selected items in that mailbox.  The click the Edit menu and select Delete.  You will get a dialog asking if you really want to delete the selections.  Answer "Delete" and the messages will get deleted.
    The olk14_message's you are seeing are the actual messages shown the Outlook mail boxes.  When you actually delete them the way I just described the corresponding olk14_message files will also be deleted.
    Note Outlook's Deleted Items mailbox is where all deleted messages go when you click the Delete tool in the Outlook toolbar.   Thus using the Delete tool from the toolbar does not permanently delete the messages.  So if you been using that for months or years you are going to have a very large Deleted Items mailbox.  And every one of those items in there is going to have a corresponding olk14_message file for that message.
    So if those olk14_message files you are seeing are from the Deleted Items mailbox you can get rid of all those corresponding olk14_message files by selecting all the messages in Deleted Items and using the Edit menu's Delete.
    Alternative ways to the Edit/Delete to do the permanent delete is select (all) the messages to delete and control (right) click to bring up the Outlook contextual menu and select Delete from it.
    Finally if you use the Delete tool in the toolbar for messages selected in the Deleted Items mailbox you will be able to permanently delete those too.  It's an exception since using the tool on the Deleted Items means there's no place to put those messages except to "oblivion".
    So, in summary, using the Delete tool in the toolbar on messages in every mailbox except the Deleted Items mailbox just moves messages to the Deleted Items mailbox.  But using the Delete tool on items in them Deleted Items mailbox permanently deletes the selected items in there.  And only permanently deleting items removes the corresponding actual ...olk14_message files.

Maybe you are looking for