Skip to content

Instantly share code, notes, and snippets.

@elhoyos
Created October 6, 2014 05:08
Show Gist options
  • Save elhoyos/53535f1067bf608119cf to your computer and use it in GitHub Desktop.
Save elhoyos/53535f1067bf608119cf to your computer and use it in GitHub Desktop.
Extracting from text files

Extracting from text files

Had the following:

/1-1-1/Screen16/screen.html
/1-1-2/Screen14/screen.html
/1-1-3/Screen12/screen.html
/1-1-3/Screen14/screen.html
/1-3-12/Screen15/screen.html
/1-3-8/Screen10/screen.html
/1-3-8/Screen11/screen.html
/1-3-8/Screen12/screen.html
/1-5-18/Screen13/screen.html
/1-5-18/Screen14/screen.html

A Module is the third number on the first set enclosed by /. So for example, in 1-5-18 the 18 is the module.

Needed to know what modules where there.

Did the following:

On vim:

: %s/\/Screen[a-z0-9\/.]*//g
: %s/\/[0-9\-]*-//g

Later on command line:

> sort -ug screens_affected.txt

To count the number of lines I did:

> sort -ug screens_affected.txt | wc -l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment