I have a list of codes that start with importing column D of an excel sheet which has a hyperlink. Then, the code moves onto importing the text version of the hyperlink and further proceeds with textual analysis.

However, my code does this analysis once for one hyperlink and I have to manually change the row number to each time I run the code.

I would like for Mathematica to automate the import/textual analysis for all the hyperlinks in column D of the excel file. The textual analysis codes are more than 30 lines and I was not entirely sure if it would be possible to automate this process. Could anyone please help?

Below is the code for only the first few lines as I do not think the textual analysis code is relevant and too long to paste here (which will go inside the loop). Thank you and I truly appreciate your help in advance!

Code below:

dataset = Dataset[Import["proxy2020sampler.xlsx"]];
dataset1 = dataset[1, All, 4];

importing only column D which contains the hyperlinks The excel file looks like below:

enter image description here

dataset2 = dataset1[21];

i have to manually update this number for each time the program runs the textual analysis

data = Import[dataset2, "Plaintext"];

Below is about 40 lines of textual analysis.

  • $\begingroup$ you have to give an example of your excel file. $\endgroup$ – Sumit Sep 8 at 14:53
  • $\begingroup$ I have updated to include a screenshot of the excel file used in the code! $\endgroup$ – Dave Sep 8 at 15:37
  • 1
    $\begingroup$ Why not just do data = Import[#, "Plaintext"]& /@ dataset[1, All, 4] $\endgroup$ – flinty Sep 8 at 16:24
  • $\begingroup$ Almost identical question posted here. $\endgroup$ – Rohit Namjoshi Sep 8 at 21:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.