Setting Fields in a File as Variables
by pitccorp01 at 2013-04-11 12:59:28
I have an input file that has two fields without headings separated by whitespace, where the first field contains names and the second field contains numbers. For example,
How can I write a Powershell script that will loop through the input file and set each line (n) of the first field as $NAME.n and each line (n) of the second field as $NMBR.n, where .n=line count?
by Nobody at 2013-04-11 13:16:44
$input = ".\testdata.txt"
$data = import-csv -path $input -delimiter " " -header "name","number"
You must be logged in to reply to this topic.