Split-NAVApplicationObjectFile

Split-NAVApplicationObjectFile

Splits a text file that contains two or more application objects into separate text files for each application object.

Syntax

Parameter Set: Default
Split-NAVApplicationObjectFile [-Source] <String> [[-Destination] <String> ] [-Force] [-PassThru] [-PreserveFormatting] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

Use the Split-NAVApplicationObjectFile cmdlet to split a text file that contains two or more application objects into separate text files for each application object. For example, if you have exported tables 18 and 27 to a single text file such as MySolution.txt, you can use the cmdlet to create two new text files, TAB18.txt and TAB27.txt.

The Split-NAVApplicationObjectFile cmdlet can copy each application object to a new file, or it can recreate the object in the new file. The default setting is to recreate the object, but you can change this by setting the PreserveFormatting parameter.

Parameters

-Destination<String>

Specifies the folder where the resulting text files must be put.

For example, to use the TXT folder that is a subfolder to the current folder, type .\TXT\.

Aliases

none

Required?

false

Position?

3

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Force

Forces the cmdlet to overwrite any existing files in the Destination folder.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PassThru

Specifies if the cmdlet must return a FileInfo object for each text file that is created. If you do not set this parameter, the cmdlet returns a list of the files.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PreserveFormatting

Specifies if you want to keep the structure of the application objects as shown in the source text file. This copies the textual descriptions of the objects line by line so that the description of the object is identical in the source file and destination file.

If you do not set this parameter, each application object is identified, translated from text to metadata, and then written to the destination text file. As a result, the object in the generated text file can look different from the source file by listing properties in a different order, or by having removed empty lines, for example.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Source<String>

Specifies the file that contains multiple application objects that you want to split into separate text files for each application object.

For example, to specify the MySolution.txt files in the SOURCE folder that is a subfolder to the current folder, type .\SOURCE\MySolution.txt.

Aliases

PSPath

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

True (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

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

Description

-----------

This example creates separate text files for each application object in the All.txt file, such as TAB18.TXT and TAB27.TXT.

PS C:\> Split-NAVApplicationObjectFile -Source C:\Solution\All.txt -Destination C:\Solution\TXT\

-------------------------- EXAMPLE 2 --------------------------

Description

-----------

This example creates separate text files for each application object in the All.txt file, such as TAB18.TXT and TAB27.TXT. By setting the PreserveFormatting parameter, each object is an exact copy, including extra line breaks or potential syntax errors. This makes it easier to compare files afterwards, for example.

PS C:\> Split-NAVApplicationObjectFile -Source C:\Solution\All.txt -Destination C:\Solution\TXT\ -PreserveFormatting