Question

Locked

Extracting single words from a text file

By dr.engnr ·
Hey. Does anybody know of a simple way to extract only particular words from a text file? I've of course tried 'find' and 'findstr' but they will only output the entire line the search is found in. I just want the single word i specify parsed out.

Any suggestions?

This conversation is currently closed to new comments.

6 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

command line

by dr.engnr In reply to grep?

i checked this out but it doesn't seem to have completed command line support. what i'm trying to do is basically extract the "?? ms" column from a tracert output.

Collapse -

re: Extracting from TraceRT

by ThumbsUp2 In reply to command line

The text file generated should be a tab separated text file. Just import it into Excel and extract what you want.

Collapse -

but

by dr.engnr In reply to re: Extracting from Trace ...

i know i could import and space delimiter the output.

i'm trying to, from only the command line, have specified words extracted from a text file and place into another (or output on the sreen).

Collapse -

cut

by NetMan1958 In reply to Extracting single words f ...

Go to http://unxutils.sourceforge.net/
and download the utilities. Unzip them and copy "cut" to your system32 directory or update your PATH to include the unxutils directory. Then (assuming your file is tab delimited) "cut -fx filename" where "x" is the field number you want to display. If the file isn't tab delimited, you can pass the delimiter to cut with the "-d delimiter" option.

Collapse -

you da man

by dr.engnr In reply to cut

Le me just say, those unxutils are fantastic. (the link you provided was dead though, found it elsewhere). I ended up being able to parse it out with the 'cut' program you mentioned.

<code>
tracert -d 4.2.2.2 | cut -f6,7,8 -d " " -n
</code>

Back to Software Forum
6 total posts (Page 1 of 1)  

Related Discussions

Related Forums