Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Powershell Combine two files into array

$
0
0

Ok I cannot combine two out put files on the fly. So I have two files  A and B. I would like to combine them in a away that I have them side by side, something like  in excel with column A and B.

I was looking into array, but cant seem to get the logic right. I also found out that when you import a file into a variable the variable is an array.

So if I have file A and B with this data.

FILE A:

a

b

c

d

e

FILE B:

1

2

3

4

5

If I am correct when Import file a to $test1 , $test1 will look like thisl.

abcde

And same for Fiile B to $test2, $test2 will look like this.

12345

when I combine the files I want to have something like this

a1
b2
c3
d4
e5

Anyone have a good powershell command for this?


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>