Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6582605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:18:03+00:00 2026-05-25T16:18:03+00:00

I am working on the sceond part of a move script and I am

  • 0

I am working on the sceond part of a move script and I am very close to a solution. I have one small stumbling block in an otherwise complete script.

I am sure this script can be condensed to make it more efficient but:

$move = $sourceDir + "\" + $_.fileName      
$csv | % {
            if ($_.folder -eq 'Y')
            {
                $move = $sourceDir + "\" + $_.fileName
                mi $_ "$move"
            }
            mi $_ "$move"
        } #end for 

The problem I have is that I need the initial move folder declared as the first value of the csv fileName colomn as it will always be a Y for the folder colomn which determines if the file is moved to that folder or the last one which had a carresponding Y.

The if statement will update the $move variable to the new move folder if present otherwise it will just keep the move folder as the last iteration and move it to that folder.

I am unsure how to reference the first value in the csv i have tried to reference it as an array fileName[1] but it did not work.

Im hopeful it is a small fix.

Thanks for taking the time to look at this.

Craig.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T16:18:03+00:00Added an answer on May 25, 2026 at 4:18 pm

    Get the value with the following:

    $csv[0].fileName
    

    In this example, ‘fileName’ is the column name in the CSV file for which we want to grab the first value ($csv[0]).

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this mysql query using PHP and first part is working fine, but
I'm working on a multi-page form. Here's the outline of its function: Part One:
Working on a small game using an HTML5 canvas, and javascript. And it's working
For my CS11 class, I have to write a small applet that draws a
I am working on a dataframe which I have previously intergrated the time and
I'm working an the second version of an application, and as part of the
I have a Delphi app with a TImgView32 control (part of Graphics32). I am
I am working on a very large application that has multiple processes running simultaneously;
I'm working on a java project and I have two class (for this topic,
[I have this working, but I don't understand why my fix to make it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.