Locut0s
Lifer
So here's what I'm trying to do. I did a raw dump of a dir command to a txt file and I want to edit out everything but the file names from the txt file. Here is an example of what the txt looks like:
10/07/2009 03:27 AM 82,779 007_-_a_view_to_kill.rar
10/07/2009 03:27 AM 101,585 007_-_goldfinger.rar
10/07/2009 03:27 AM 221,073 007_licence_to_kill.rar
11/08/2005 05:38 PM 316,779 1 To Nil Soccer Manager (1992)(Wizard Games Of Scotland Ltd).zip
11/08/2005 05:38 PM 1,203,348 1000 Miglia (1991)(Simulmondo).zip
11/08/2005 05:38 PM 100,283 100000 Pyramid (1988)(Basada).zip
11/08/2005 05:38 PM 30,017 10th Frame (1986)(Access Software Inc).zip
11/08/2005 05:38 PM 645,102 15x15 Picture Puzzle (1996)(Freeware).zip
11/08/2005 05:38 PM 4,129,713 1830 Railroads And Robber Barons (1995)
So I was going to use a regular expression search and replace to strip out everything before the file names. Stupid thing is I got 1/2 way in before I realized that in the actual txt file all the file names all start exactly 39 character in so I could have just deleted the first 39 characters of each line (stupid me). Anyway now that I am doing this I have a different question. Supposing I want to do it the hard way like I was doing it what would be a good regular expression to match this first section. What I came up with works but it looks awkward. Is there a better way?
I came up with this:
[:digit:]{2}/[:digit:]{2}/[:digit:]{4}[:space:]{2}[:digit:]{2}:[:digit:]{2}[:space:]{1}(AM|PM)
QUESTION 2
Suppose I do just want to match the first 39 character of each line. I would think this would do it:
^[😛rint:]{39}
And it does. However in Open Office which is what I'm using it keeps matching ANY 39 character stretch so if there are 78 characters on the line it will match both 39 char segments when all I want it to do is pick up ONLY the first 39char part of each line and nothing after that on the line.
Example if I wanted to match the first 4 chars instead of the first 39 I would want this:
[asdf]jhasdkfjhasdkjfhqw
Instead I'm getting this
[asdf][jhas][dkfj][hasd][kjfh]qw
10/07/2009 03:27 AM 82,779 007_-_a_view_to_kill.rar
10/07/2009 03:27 AM 101,585 007_-_goldfinger.rar
10/07/2009 03:27 AM 221,073 007_licence_to_kill.rar
11/08/2005 05:38 PM 316,779 1 To Nil Soccer Manager (1992)(Wizard Games Of Scotland Ltd).zip
11/08/2005 05:38 PM 1,203,348 1000 Miglia (1991)(Simulmondo).zip
11/08/2005 05:38 PM 100,283 100000 Pyramid (1988)(Basada).zip
11/08/2005 05:38 PM 30,017 10th Frame (1986)(Access Software Inc).zip
11/08/2005 05:38 PM 645,102 15x15 Picture Puzzle (1996)(Freeware).zip
11/08/2005 05:38 PM 4,129,713 1830 Railroads And Robber Barons (1995)
So I was going to use a regular expression search and replace to strip out everything before the file names. Stupid thing is I got 1/2 way in before I realized that in the actual txt file all the file names all start exactly 39 character in so I could have just deleted the first 39 characters of each line (stupid me). Anyway now that I am doing this I have a different question. Supposing I want to do it the hard way like I was doing it what would be a good regular expression to match this first section. What I came up with works but it looks awkward. Is there a better way?
I came up with this:
[:digit:]{2}/[:digit:]{2}/[:digit:]{4}[:space:]{2}[:digit:]{2}:[:digit:]{2}[:space:]{1}(AM|PM)
QUESTION 2
Suppose I do just want to match the first 39 character of each line. I would think this would do it:
^[😛rint:]{39}
And it does. However in Open Office which is what I'm using it keeps matching ANY 39 character stretch so if there are 78 characters on the line it will match both 39 char segments when all I want it to do is pick up ONLY the first 39char part of each line and nothing after that on the line.
Example if I wanted to match the first 4 chars instead of the first 39 I would want this:
[asdf]jhasdkfjhasdkjfhqw
Instead I'm getting this
[asdf][jhas][dkfj][hasd][kjfh]qw