Difference: 0LASubrTextParseLine (1 vs. 11)

Revision 112023-04-10 - BrianRyan

Line: 1 to 1
 
META TOPICPARENT name="APPXRuntimeSubroutineAPI"

.TEXT PARSE LINE

Line: 33 to 33
  - A file called --- PARSED is returned containing one record for each column. There are no size or number of columns limitations when results are returned in this file. If the current process references the --- .TEXT PARSE RESULT field, it will also be populated (subject to the restrictions above).
Added:
>
>
Note: This subroutine is designed to operate on Alpha, Text, and Token fields only. The returned results are undefined if you specify any other type of field.
 Comments:

Read what other users have said about this page or add your own comments.

Revision 102020-03-17 - JeanNeron

Line: 1 to 1
 
META TOPICPARENT name="APPXRuntimeSubroutineAPI"

.TEXT PARSE LINE

Line: 20 to 20
  <text_to_parse> contains the text you want parsed (Required).
Changed:
<
<
<delimiter> is the single character to use as a field delimiter (Optional). If not PASSed, it will default to a Tab character. If you need to use a space as a delimiter, pass an underscore character ("_"). In this case the routine will see any trailing blanks as additional fields so the <no_of_fields> count will be wrong and --- .TEXT PARSE RESULT will contain 'Max Occur Exceeded'.
>
>
<delimiter> is the single character to use as a field delimiter (Optional). If not PASSed, it will default to a Tab character. If you need to use a space as a delimiter, pass an underscore character ("_"). Prior to Release 5.5, the routine will see any trailing blanks as additional fields so the <no_of_fields> count will be wrong and --- .TEXT PARSE RESULT will contain 'Max Occur Exceeded'.
  <no_of_fields> returns the number of fields that were found in <text_to_parse> (Optional). This must be PASSed with Share "Y" to return a value.

Revision 92018-08-17 - JeanNeron

Line: 1 to 1
 
META TOPICPARENT name="APPXRuntimeSubroutineAPI"

.TEXT PARSE LINE

Line: 33 to 33
  - A file called --- PARSED is returned containing one record for each column. There are no size or number of columns limitations when results are returned in this file. If the current process references the --- .TEXT PARSE RESULT field, it will also be populated (subject to the restrictions above).
Changed:
<
<
- Fields surrounded by quotes will have the quotes removed (unless they are embedded in the the field).

- Delimiters enclosed in quotes will not act as a delimiter, ie, "Jacksonville, Florida" will be returned as one field (assuming a comma delimiter).

- A backslash acts as an escape character to negate the following special character. For example:

  • C:\\Test will return C:\test
  • "embdded \" quote" will return 'embedded " quote'

Comments:

>
>
Comments:
  Read what other users have said about this page or add your own comments.

Revision 82018-05-07 - JeanNeron

Line: 1 to 1
 
META TOPICPARENT name="APPXRuntimeSubroutineAPI"

.TEXT PARSE LINE

Line: 25 to 25
 <no_of_fields> returns the number of fields that were found in <text_to_parse> (Optional). This must be PASSed with Share "Y" to return a value.

The parsed data will be available in the --- .TEXT PARSE RESULT work field. You do not have to PASS this field. This is a multi occurence work field, each occurence is 512 bytes and there are a maximum of 100 occurrences. If one of the parsed fields is larger than 512 bytes, then --- .TEXT PARSE RESULT will contain 'Data Truncation'. If there are more than 100 fields parsed, then --- .TEXT PARSE RESULT will contain 'Max Occur Exceeded' and only the first 100 fields will be returned.

Changed:
<
<

Updates starting in 6.0.1

>
>

Changes in 6.0.1

  Starting in Release 6.0.1, this routine has been enhanced:

- All processing has been moved to the APPX engine for faster performance

Changed:
<
<
- A file called --- PARSED is returned containing one record for each column. There are no size or number of columns limitations when results are returned in this file. If your application references the --- .TEXT PARSE RESULT field, it will also be populated subject to the restrictions above.
>
>
- A file called --- PARSED is returned containing one record for each column. There are no size or number of columns limitations when results are returned in this file. If the current process references the --- .TEXT PARSE RESULT field, it will also be populated (subject to the restrictions above).
  - Fields surrounded by quotes will have the quotes removed (unless they are embedded in the the field).

Revision 72018-05-07 - JeanNeron

Line: 1 to 1
 
META TOPICPARENT name="APPXRuntimeSubroutineAPI"

.TEXT PARSE LINE

Line: 31 to 31
  - All processing has been moved to the APPX engine for faster performance
Changed:
<
<
- The --- PARSED file is returned containing one record for each column. If your application references the --- .TEXT PARSE RESULT field, it will also be populated subject to the restrictions above. The --- PARSED file does not have the same limitations.
>
>
- A file called --- PARSED is returned containing one record for each column. There are no size or number of columns limitations when results are returned in this file. If your application references the --- .TEXT PARSE RESULT field, it will also be populated subject to the restrictions above.
  - Fields surrounded by quotes will have the quotes removed (unless they are embedded in the the field).
Added:
>
>
- Delimiters enclosed in quotes will not act as a delimiter, ie, "Jacksonville, Florida" will be returned as one field (assuming a comma delimiter).
 - A backslash acts as an escape character to negate the following special character. For example:
  • C:\\Test will return C:\test
  • "embdded \" quote" will return 'embedded " quote'

Revision 62018-05-07 - JeanNeron

Line: 1 to 1
 
META TOPICPARENT name="APPXRuntimeSubroutineAPI"

.TEXT PARSE LINE

Line: 25 to 25
 <no_of_fields> returns the number of fields that were found in <text_to_parse> (Optional). This must be PASSed with Share "Y" to return a value.

The parsed data will be available in the --- .TEXT PARSE RESULT work field. You do not have to PASS this field. This is a multi occurence work field, each occurence is 512 bytes and there are a maximum of 100 occurrences. If one of the parsed fields is larger than 512 bytes, then --- .TEXT PARSE RESULT will contain 'Data Truncation'. If there are more than 100 fields parsed, then --- .TEXT PARSE RESULT will contain 'Max Occur Exceeded' and only the first 100 fields will be returned.

Added:
>
>

Updates starting in 6.0.1

Starting in Release 6.0.1, this routine has been enhanced:

- All processing has been moved to the APPX engine for faster performance

- The --- PARSED file is returned containing one record for each column. If your application references the --- .TEXT PARSE RESULT field, it will also be populated subject to the restrictions above. The --- PARSED file does not have the same limitations.

- Fields surrounded by quotes will have the quotes removed (unless they are embedded in the the field).

- A backslash acts as an escape character to negate the following special character. For example:

  • C:\\Test will return C:\test
  • "embdded \" quote" will return 'embedded " quote'
 

Comments:

Read what other users have said about this page or add your own comments.

Line: 35 to 48
  -- AlKalter - 2012-06-12
Changed:
<
<
i have an input file where date fields are displayed as for example 4-3-2013 To my astonishment the field --- .TEXT PARSE RESULT is now filled as 2013-03-04. I have looked a few times but it seems the subr. .TEXT PARSE LINE does that too. Am I right?
>
>
i have an input file where date fields are displayed as for example 4-3-2013 To my astonishment the field --- .TEXT PARSE RESULT is now filled as 2013-03-04. I have looked a few times but it seems the subr. .TEXT PARSE LINE does that too. Am I right?
  -- WimJongejan - 2013-10-14

no I am not right. Excel changed the field

Changed:
<
<
-- WimJongejan - 2013-10-15
<--/commentPlugin-->
>
>
-- WimJongejan - 2013-10-15
<--/commentPlugin-->
  -- JeanNeron - 2012-02-10 \ No newline at end of file

Revision 52016-07-25 - JeanNeron

Line: 1 to 1
 
META TOPICPARENT name="APPXRuntimeSubroutineAPI"

.TEXT PARSE LINE

Line: 20 to 20
  <text_to_parse> contains the text you want parsed (Required).
Changed:
<
<
<delimiter> is the single character to use as a field delimiter (Optional). If not PASSed, it will default to a Tab character.
>
>
<delimiter> is the single character to use as a field delimiter (Optional). If not PASSed, it will default to a Tab character. If you need to use a space as a delimiter, pass an underscore character ("_"). In this case the routine will see any trailing blanks as additional fields so the <no_of_fields> count will be wrong and --- .TEXT PARSE RESULT will contain 'Max Occur Exceeded'.
  <no_of_fields> returns the number of fields that were found in <text_to_parse> (Optional). This must be PASSed with Share "Y" to return a value.
Line: 29 to 29
  Read what other users have said about this page or add your own comments.
Deleted:
<
<

 Note that this excellent and powerful subroutine does not differentiate between delimiter characters within quotation marks and those that are actual delimiters. So if you have a CSV file with text fields that include commas, the results will not be what you expect.
Changed:
<
<
One work-around would be to read through the string beforehand, keep track of when you're within quotes and when you're not, and change the actual delimiters from commas to tabs, since tabs are rarely found within field content. Of course, you could use some other character as well, but I found that tabs did the trick.
>
>
One work-around would be to read through the string beforehand, keep track of when you're within quotes and when you're not, and change the actual delimiters from commas to tabs, since tabs are rarely found within field content. Of course, you could use some other character as well, but I found that tabs did the trick.
  -- AlKalter - 2012-06-12

Revision 42013-10-15 - WimJongejan

Line: 1 to 1
 
META TOPICPARENT name="APPXRuntimeSubroutineAPI"

.TEXT PARSE LINE

Line: 44 to 44
 I have looked a few times but it seems the subr. .TEXT PARSE LINE does that too. Am I right?

-- WimJongejan - 2013-10-14

Added:
>
>

no I am not right. Excel changed the field

-- WimJongejan - 2013-10-15

 
<--/commentPlugin-->

-- JeanNeron - 2012-02-10 \ No newline at end of file

Revision 32013-10-14 - WimJongejan

Line: 1 to 1
 
META TOPICPARENT name="APPXRuntimeSubroutineAPI"

.TEXT PARSE LINE

Line: 36 to 36
 One work-around would be to read through the string beforehand, keep track of when you're within quotes and when you're not, and change the actual delimiters from commas to tabs, since tabs are rarely found within field content. Of course, you could use some other character as well, but I found that tabs did the trick.

-- AlKalter - 2012-06-12

Added:
>
>

i have an input file where date fields are displayed as for example 4-3-2013 To my astonishment the field --- .TEXT PARSE RESULT is now filled as 2013-03-04. I have looked a few times but it seems the subr. .TEXT PARSE LINE does that too. Am I right?

-- WimJongejan - 2013-10-14

 
<--/commentPlugin-->

-- JeanNeron - 2012-02-10 \ No newline at end of file

Revision 22012-06-12 - AlKalter

Line: 1 to 1
 
META TOPICPARENT name="APPXRuntimeSubroutineAPI"

.TEXT PARSE LINE

Line: 29 to 29
  Read what other users have said about this page or add your own comments.
Changed:
<
<

<--/commentPlugin-->
>
>

Note that this excellent and powerful subroutine does not differentiate between delimiter characters within quotation marks and those that are actual delimiters. So if you have a CSV file with text fields that include commas, the results will not be what you expect.

One work-around would be to read through the string beforehand, keep track of when you're within quotes and when you're not, and change the actual delimiters from commas to tabs, since tabs are rarely found within field content. Of course, you could use some other character as well, but I found that tabs did the trick.

-- AlKalter - 2012-06-12

<--/commentPlugin-->
  -- JeanNeron - 2012-02-10

Revision 12012-02-10 - JeanNeron

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="APPXRuntimeSubroutineAPI"

.TEXT PARSE LINE

This subroutine parses a string into separate fields.


Usage:

      PASS         <text_to_parse>            FIELD            SHARE? N
      PASS         <delimiter>                FIELD            SHARE? N
      PASS         <no_of_fields>             FIELD            SHARE? Y
      GOSUB    --- .TEXT PARSE LINE
      *        Check for errors
      IF       --- .TEXT PARSE LINE           NE

Description:

This subroutine parses a string into separate fields. The first parameter is required, if it is not received the subroutine will CANCEL.

<text_to_parse> contains the text you want parsed (Required).

<delimiter> is the single character to use as a field delimiter (Optional). If not PASSed, it will default to a Tab character.

<no_of_fields> returns the number of fields that were found in <text_to_parse> (Optional). This must be PASSed with Share "Y" to return a value.

The parsed data will be available in the --- .TEXT PARSE RESULT work field. You do not have to PASS this field. This is a multi occurence work field, each occurence is 512 bytes and there are a maximum of 100 occurrences. If one of the parsed fields is larger than 512 bytes, then --- .TEXT PARSE RESULT will contain 'Data Truncation'. If there are more than 100 fields parsed, then --- .TEXT PARSE RESULT will contain 'Max Occur Exceeded' and only the first 100 fields will be returned.

Comments:

Read what other users have said about this page or add your own comments.


<--/commentPlugin-->

-- JeanNeron - 2012-02-10

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback