Hot answers tagged

91

less filename From the command line, it lets you view files straightaway without loading the full file into memory.


72

You can use OptionShift⌘-V to paste and match the current style. This removes all previous formatting, links, etc. If you would like to make this the default action when pressing ⌘V, open System Preferences -> Keyboard -> Keyboard Shortcuts, and select Application Shortcuts from the list on the left. Then, hit + to make a new shortcut, select ...


37

I would not try to open it... I'd rather do: grep - look for some text split - chop the file into say 10Mb chunks. Something like: grep "crash" My80GbFile.txt | more If the big file is not "Line delimited" split -b 10M My80GbFile.txt But if the big file is just a load of lines, then (as was posted), split by line (100,000 per sub-file) in this case. ...


30

iconv is definitively the tool of choice here: iconv -f MACROMAN -t UTF-8 your-roman-encoded-file.txt > utf-8-encoded-file.txt Run iconv --list to see a list of all supported encodings.


26

In terms of your immediate needs, the best free visual editor for macOS is BBEdit (linked to the Mac App Store download) and it does so much - a true powerhouse. Once you have it, you can also pay up for the pro / automation / out of gratitude features, but it's free forever if you want and like that price. https://www.barebones.com/products/bbedit/index....


25

QLStephen is a more general solution that works for all kinds of text files.


18

Text messages from your Mac are actually sent through your iPhone. On your iPhone go to the Settings app → Messages → Text Message Forwarding. You may need to re-do the setup by removing and re-adding your Mac in there.


17

Open the Terminal application Type or paste defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO Press ↩︎ (Enter) Restart the computer To return it back, do the same but instead type in the terminal defaults write -g CGFontRenderingFontSmoothingDisabled -bool YES Update on 2019.10.12: the solution works in macOS 10.15 too. Update on 2019.12....


16

Yes, you certainly can! Just start typing your word and press F5 to reveal up to 20 possible words. To use your example, below is a screenshot showing how this works when I type envir and press the F5 key: You can then use the arrow keys (or mouse) to select the word you want (or just hit enter to accept the first word). And, because this only appears when ...


15

You can click on the magnifying glass icon and choose Insert Pattern or press ⌃ CTRL+⌥ ALT+⌘ CMD+P Then pick Line Break


15

In systems up to 10.11.6 you can save the "Purchased" page as html file to disk: Quit App Store.app Open Terminal.app in /Applications/Utilities Enter defaults write com.apple.appstore ShowDebugMenu -bool true and hit the Return/⏎ key to show the debug menu in App Store.app. Open App Store.app (check that the "Debug" menu is available!) If you have some ...


14

As far as I know there's no preference to enable this, it's just a built-in feature with no on/off switch. My best advice is to make sure that you hold down the mouse before starting to drag the text. There's some delay built in such that if you try to drag too quickly, you'll just end up selecting more text. The process that works for me is: Select the ...


12

Just don't (open it as ONE file) Is there any specific reason that you can not simply break it into about 1GB chunks with a script? Yes, searching and similar functionality will suffer but that will already be the case with a 80GB file. If you have specific break points in the script (days in the timestamp, startup / shutdown messages) you could also ...


11

The Speech Synthesis Programming Guide describes the embedded speech commands that you can use to adjust how the speech synthesis engines process your input text. The [[inpt PHON]] command enables the use of phonemes and phoneme modifiers. For example, the following text includes a phonemic version of your chosen word (select the text, Control-click, and ...


11

If you have a Touch Bar, you can enable ‘Touch Bar typing suggestions’. This shows the same 3 options you're used to on iOS on the Touch Bar as you type. This will also show emoji suggestions like iOS. Enable it from System Preferences → Keyboard → Text → Touch Bar typing suggestions.


10

Both Klanomath and PeterVP provide suitable answers. If all you want is a list of the apps, I'd refer you to those. However, if you'd like other details included (such as Version etc) or you just don't like using Terminal, you can achieve what you want with these steps: Go to Apple > About This Mac Click on the System Report... button on the window that ...


10

Globbing isn't random, it's guaranteed to be alphabetical (a.k.a. lexicographic order according to your locale), which is different from numeric sorting order. You can use brace expansion for this. Replace '10' with the number of the last file. cat {1..10}.txt > merged.txt This uses bash brace expansion, which you can read about at LESS='+/Brace ...


10

Use less in a terminal window. It will show you one page at a time of the file, will only load about that much in memory, so you can navigate multi-TB files with it if you want. You probably should add the -n option to prevent less from trying to compute line numbers. So: less -n /path/to/file Remember you can type less -n (don't forget the final space) ...


9

A simple trick is to just copy the rest of a line and paste it into the "replace" field. Works with Textedit, Xcode etc.


9

This answer has been updated to reflect rubik's sphere's misunderstanding between what Rich Text is (what was originally asked about) and what's actually being worked with from Google Chrome, being HTML. (See comments moved to chat.) I'm leaving the original answer as is, and below this new content, as it does technically answer the original question as ...


9

With disk based text editors, the file is not loaded entirely into memory - what you see on the UI is a peek into the contents the editor has loaded into memory. I have used UltraEdit successfully in the past to do large log file analysis. Its regex based search tools and location bookmarks are especially useful. It loads the file snappily, and you can do ...


8

I suggest that you try the “Paste and match style” menu command, right below “Paste” - the corresponding shortcut is ⇧–⌥–⌘-V. It will paste the content, but strip all the associated formatting.


8

Another way to convert non-ASCII characters to ASCII variants is to use iconv -t ASCII//TRANSLIT: $ echo ‘’“”–—…äé | iconv -t ASCII//TRANSLIT ''""--..."a'e ASCII//IGNORE would remove non-ASCII characters, but you can also do that with for example tr -dc '\0-\177'.


8

You can use Unicode combining character U+0305 COMBINING OVERLINE. It can be found by searching in the palette from Edit → Emoji & Symbols (formerly Edit → Special Characters…), or by using a specialized keyboard layout such as the built-in Unicode Hex Input or my own custom one mostly designed for mathematics. Here's some sample text with overlines, ...


8

People can develop plugins to allow Quick Look to support more file types. You can find Apple's Quick Look documentation here. Luckily though Timac (aka Alexandre Colucci) has already created one. You can find Timac's Quick Look plugin for strings files here. Just download the compiled plugin, copy it to your /Library/QuickLook folder and run the qlmanage -...


8

I use a shell script, in Terminal enter: find /Applications -path '*Contents/_MASReceipt/receipt' -maxdepth 4 -print |\sed 's#.app/Contents/_MASReceipt/receipt#.app#g; s#/Applications/##' This will list all applications you bought on the Mac App Store. If you redirect the result to a text file like so: find /Applications -path '*Contents/_MASReceipt/...


8

It's possible with CoreGraphics (CGEventPost), it's a C API (it doesn't work in a Cocoa-AppleScript), but it's possible to call an executable from an AppleScript. Here is the method to create the executable with Xcode (Version 8.3.3): You can do it yourself (you can download Xcode from the App Store), or ask a trusted person to create the executable. 1- ...


7

You could use launchd. launchd lets you manage daemons and agents according to certain conditions. What are daemons and agents? From man launchd: A "daemon" is, by definition, a system-wide service of which there is one instance for all clients. An "agent" is a service that runs on a per-user basis. Daemons should not attempt to display UI or ...


7

You can use QuicklookStephen (https://github.com/whomwah/qlstephen). Install via Brew: brew cask install qlstephen and then reset the Quicklook plugins: qlmanage -r and you should be good to go! Tested with both files without extension and files with "unknown" extension (e.g. .nfo)


7

If your paragraphs are separated by a blank line, you can do this with a two-part Find and Replace in TextEdit. Open the Find and Replace dialog (⌥⌘F). In the Find field, insert the newline character by typing option-return. In the Replace field, insert a space, then click All. This replaces all newlines with a space, so you'll have one long line of all ...


Only top voted, non community-wiki answers of a minimum length are eligible