Computing.Net > Forums > Programming > batch script to parse text file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

batch script to parse text file

Reply to Message Icon

Name: afall
Date: August 5, 2008 at 13:09:20 Pacific
OS: 2003
CPU/Ram: xeon 4gb
Comment:

I have problem writing this batch file to read a text file. Been using the for /f command but doesn't seem to be working. This is a sample of the text file.

HLU/ALU Pairs:

HLU Number ALU Number
---------- ----------
0 3
1 1
Shareable: YES

The HLU and ALU are two different column with number under each.

What I want is to extract the number under the ALU number into a seperate text file. I.e it would be the number 3 and 1. Any help or guiding me in the right direction would be grateful.

thousand way to get it wrong one way to get it right.



Sponsored Link
Ads by Google

Response Number 1
Name: ghostdog
Date: August 5, 2008 at 18:04:10 Pacific
Reply:

if you can download gawk for windows here:http://gnuwin32.sourceforge.net/packages/gawk.htm


{print $2}

save the above as script.awk and on command line

c:\test> gawk -f script.awk file


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: batch script to parse text file

batch script for parsing text file www.computing.net/answers/programming/batch-script-for-parsing-text-file/18755.html

batch file to parse text file www.computing.net/answers/programming/batch-file-to-parse-text-file/18030.html

batch script to pick thelatest file www.computing.net/answers/programming/batch-script-to-pick-thelatest-file/16427.html