< Back

Split-File

Mon Jan 13, 2020 2:33 am

NAME Split-File



SYNOPSIS

Splits an input CSV file into smaller CSV files with the specified header.





SYNTAX

Split-File [-InputFilePath] <String> [-SplitCount] <Int32> [-OutputBasePath] <String> [[-FileHeader] <String>]

[<CommonParameters>]





DESCRIPTION

Splits an input CSV file into smaller CSV files with the specified header.





PARAMETERS

-InputFilePath <String>

Path of Input File.



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



-SplitCount <Int32>

Number of files to create from input file.



Required? true

Position? 2

Default value 0

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



-OutputBasePath <String>

Base Path for output files.



Required? true

Position? 3

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



-FileHeader <String>

(Optional) Header to include in each file



Required? false

Position? 4

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

List of files created





NOTES





AUTHOR: Cyrus Jamula

LASTEDIT: Febuary 13th, 2018



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>.\\splitfiles.ps1 -splitSize 10 `



-inputFile D:\\temp\\purchase\\preorder\\aoe_refund\\aoe_to_refund.csv `

-outputBasePath D:\\temp\\purchase\\preorder\\aoe_refund_test `

-header "OrderId,PurchaserIdentity,ProductId,Market,OrderPlacedDate,OrderReleaseDate,OrderState,BillingState"











RELATED LINKS