Forum Replies Created

Viewing 15 posts - 571 through 585 (of 686 total)

  • Reply To: parse files in folder

    param (
    [parameter(mandatory = $true, ValueFromPipelineByPropertyName = $true)][AllowEmptyString()][string]$Sender,
    [parameter(mandatory = $true, ValueFromPipelineByPropertyName = $true)][AllowEmptyString()][string]$FileDate,
    [parameter(mandatory = $true, ValueFromPipelineByPropertyName = $true)][AllowEmptyString()][string]$RecordType
    )

    # Check for at least one parameter selected
    if ($Sender -eq ""...
  • Reply To: parse files in folder

    I really appreciate all of your help and suggestions, and code...  I'll see if I can take your snippets and code samples

    to try and see if I can get a...

  • Reply To: parse files in folder

    Is there anything you can run to determine types of files your processing?

  • Reply To: parse files in folder

    I was using:

    $fileData = [System.Text.Encoding]::UTF8.GetString($bytes);

     

  • Reply To: parse files in folder

    What would the code look like that follows the rules outlined above that looks at specific positions within the data record. I checked the records and for Inbound ISA records...

  • Reply To: parse files in folder

    Would this make the script any easier for lookups and speed.

    Seems like there are 2 different formats the records could use for Inbound(which I would already know because of the...

  • Reply To: parse files in folder

    I outputted these values:

    # Validate this is an EDI file

    $fileData.Substring(0,3)

    ISA

    # Get the data element separator and segment element separator

    $dataElement = $fileData.Substring(3,1);

    *

    $segmentElement = $fileData.Substring(105,1);

    {

    It seems the record start at zero(0) based...

  • Reply To: parse files in folder

    I put output for filenames and found that the delimiter switched from * to a bar(|) delimiter.  Is there a way to dynamically

    figure out delimiter?

     

    Thanks for suggestions..

  • Reply To: parse files in folder

    Thanks for update to script...

    I started it and got a message:

    You cannot call a method on a null-valued expression

    Error came from:

    if (($firstRow[6].Trim() -eq $Sender -or $Sender -eq "") -and ($firstRow[9]...

  • Reply To: parse files in folder

    Thanks for replies... I'll test that code out..

     

    Do you anticipate with 1000's of files to search this lookup to be slow?

     

    Thanks.

  • Reply To: parse files in folder

    Could you inject that into the code so I can see how that may work, do I still you default values in script?

    Thanks for response..

  • Reply To: parse files in folder

    If I set a default value that maybe not the date I'm searching for that sender or the RecordType.

    or if I search for Date it maybe not the sender(if I...

  • Reply To: parse files in folder

    When I call with just sender parn

    You cannot call a method on a null-valued expression.

    At C:\PowerShell\edi_archive_lookup.ps1:8 char:1

    + $strFileDate = $FileDate.ToString("yyMMdd");

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo : InvalidOperation: (:) [], RuntimeException

    + FullyQualifiedErrorId : InvokeMethodOnNull

  • Reply To: parse files in folder

    param (
    [parameter(mandatory = $false, ValueFromPipelineByPropertyName = $true)][string]$sender,
    [parameter(mandatory = $false, ValueFromPipelineByPropertyName = $true)][datetime]$fileDate,
    [parameter(mandatory = $false, ValueFromPipelineByPropertyName = $true)][string]$RecordType
    )

    # Convert input date to string YYMMDD
    $strFileDate = $FileDate.ToString("yyMMdd");

    # Get list...
  • Reply To: parse files in folder

    Would a record up to character 106 work?

Viewing 15 posts - 571 through 585 (of 686 total)