0

In Numbers on a MacBook Pro Early 2013, how can one jump to a specific line, such as line 4223860.

The data is actually csv formatted, and I have no clue what is inside that line.

Any help is very much appreciated.

  • Can Numbers even open a file containing that many lines? I don't think so. – user3439894 Oct 4 '16 at 18:04
  • No it can't - so sorry. – canIchangethis Oct 4 '16 at 18:09
1

If you have trouble opening the file and you just want to see that line try the following in Terminal. If you have never used Terminal before, note that you must navigate to the directory where the file is first, the easiest is to copy that file to your Desktop and run the following command in Terminal to navigate to your desktop folder:

cd ~/Desktop

Then run this command:

head -4223860 mybigfile.csv|tail -1 > export.csv

where "mybigfile.csv" would be your filename and export.csv is the name of the exported file. You can also display the line in terminal without saving to any file with:

head -4223860 mybigfile.csv|tail -1
  • Thanks, I really like that answer, but it gives me back "weird stuff" something like Kopie.csv$4HX(≈O^VûÍJ∆1aƒ‘AΩî'ä˛':A∂Ôë⁄$9AC879?4AB-98C3-4BC7C356C5F??????Ã˛ˇˇˇx‰@ » 8 H | \ l ®0 0–0–X"‘ – canIchangethis Oct 4 '16 at 19:18
  • 1
    are you sure the file is a CSV file? a CSV file should be easily readable with a text editor. If it is not in CSV format this will not work and what you copied does not seem in to be in CSV – user1579874 Oct 4 '16 at 19:32
  • well it is and the first rows looked good in numbers - it's just not all of them – canIchangethis Oct 4 '16 at 19:43
0

You can't do this in Numbers natively, but AppleScript helps:

  1. Create an AppleScript select_cell in Script Editor with the following content:

    _main()
    on _main()
        tell application "Numbers"
            if not (exists document 1) then return
            set {table:_table} to my _selection(document 1)
            if _table is missing value then
                display dialog "Select some cell(s) in target table first"
                return
            end if
            tell _table
                set {rk, cn} to {count rows, column -1's name}
            end tell
    
            repeat
                display dialog "Enter cell name" & return & ¬
                    "  row in 1.." & rk & return & ¬
                    "  column A.." & cn default answer ("A" & rk) with title "Select Cell"
                set cellname to text returned of result
                try
                    tell _table
                        set selection range to range cellname
                    end tell
                    exit repeat
                on error
                    display dialog "Unable to select the specified cell: " & cellname
                end try
            end repeat
        end tell
    end _main
    
    on _selection(doc)
        (*  
            reference doc : target document  
            return record : {range:_range, table:_table, sheet:_sheet}  
                _range = reference to named range in selection  
                _table = table object to which selection range belongs  
                _sheet = sheet object to which selection range belongs  
        *)
        (*  
            Limitation  
                Numbers allows to select uncontinuous regions  
                but its scripting interface does not provide decent method to retrieve them.  
    
                If uncontinuous regions are selected, 'selection range' returns the minimum continuous region  
                which includes all the regions in selection.  
        *)
        script o
            property parent : {}
            property pp : {}
            local q, r, s, _range, _table, _sheet
            tell application "Numbers"
                set pp to doc's every sheet's every table's selection range as list
                repeat with p in my pp -- per sheet  
                    set q to p's every specifier -- retrieve object (filtering out missing value)  
                    if q ≠ {} then
                        set q to q's item 1 -- selection range object [1]  
                        set r to q as record -- selection range object specifier record [2]  
                        set _table to r's every specifier's item 1 -- container table reference [3]  
                        set s to (a reference to _table's selection range) -- selection range reference [4]  
                        set _range to (a reference to _table's range (s's name)) -- named range reference [5]  
                        set _sheet to (_table as record)'s every specifier's item 1 -- container sheet reference [3]  
                        return {range:_range, table:_table, sheet:_sheet}
                    end if
                end repeat
                return {range:missing value, table:missing value, sheet:missing value}
            end tell
            (*  
                [1] class specifier for 'range' is broken in Numbers 09  
                [2] «class want» value is broken in Numbers 09  
                [3] simple method to get «class from» value without asking for «class from» key which causes trouble in recompilation of the token 'from'.  
                [4] proper reference of selection range object  
                [5] proper reference of named range object  
            *)
        end script
        tell o to run
    end _selection
    

    and and place it in ~/Library/Scripts/Applications/Numbers.

  2. In Script Editor's preferences choose "General" and enable "Show Script menu in menu bar".
  3. Now, if you want to jump to a cell in an open Numbers document, open the script menu in the menubar -> select_cell and enter the cell coordinates (e.g. B56 or A12094). The cell has to exist though: if your Numbers file only contains 120 rows and 2 columns you can't jump to cell G1500.

A limit of 65535 rows and 255 columns seems to exist for Numbers files. So a "line" 4223860 can't be imported and consequently can't be shown.


Tested in 10.9.5 and Numbers 3.2.2. Shamelessly stolen there: source - which also provides other methods including one with a shortcut.

  • Thanks, but as commented on top, my file is too long for numbers :( – canIchangethis Oct 4 '16 at 19:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .