0

I've created a script using invoke-webrequest and filtered the information I need and exported the data to a CSV file, The data is formatted into list view and therefore the data extracted is placed onto a new row down the CSV file (which suits my needs quite fine).

Now I've imported that CSV back into Powershell and I want to select certain cells of information from it. Is there a way of selecting particular cells into a variable that I can use else where in my script.

Much appreciated, Cheers, For example Setting $ie1 to hold data from A5 Setting $ie2 to hold data from A10 Setting $ie3 to hold data from A15

ritch3r
  • 11
  • 1
  • If you say _"The data is formatted into list view"_, then to me that sounds like it is no longer a CSV to work with, instead, a series of lines in a text file. Next you talk about column names as in Excel (`A10`, `A15`).. Without showing **ANY** of all this, there is no way we can help you.. – Theo May 05 '20 at 09:25

1 Answers1

0

You can import the CSV into an array: $array = @(Import-CSV "temp.csv"), then address individual cells by row and column number.

The address scheme column letter/row number is specific to spreadsheet programs, but you can write a translation function if you find it useful.

Answer based on STGdb's comment on this question

Alistair Wall
  • 332
  • 1
  • 2
  • 3