parsed.org

Tips by tag: split

Take the location, convert to string, and split twice:

vidID = document.location.toString().split("v=")[1].split("&")[0];
javascriptsplityoutube
Log Chopping by http://xinu.myopenid.com/ on Jan 12, 2005 11:01 AM

Given a log file with a date in the first column, chop up the file into separate file:

$ awk '/^[0-9]/ {print $0 > $1".log"}' logfile.txt

If you have a string that has characters that the shell won't like, you can do a substitution on them:

$ awk '{gsub("/","_",$1); print $1 > $1".log"}' logfile.txt
awkchoplogshellsplit
Split Screen Resizing by http://xinu.myopenid.com/ on Apr 03, 2007 08:22 AM

If you want to split screens and only need a few lines for one of them type the following after you use your control key (Ctrl+A by default):

:resize -10 (removes 10 lines)
gnuscreensplit
Split Screens by http://xinu.myopenid.com/ on Jan 12, 2005 10:13 AM

While running screen, run the following sequence:

C-a S

Then run the following sequence to change focus:

C-a C-i

To collapse the splits to the one you're currently on:

C-a Q
keystrokesscreensplit

Use split to move blocks of text around rather than having multiple terminals open. Open the file you want using the split command:

split: path/to/file

C-w and then k or j will move you between vertically between the buffers when you are not in insert mode (up and down, respectively). For example, this makes moving text between files much easier.

buffercommandeditorssplitterminaltextwindow
RSS