
NB. Created app def file is as follows

NB. ====================================================================================================
NB. ====  (1/4) name of application =======
NB./*/APP_FOLDER_NAME/02_02_demo_number_list_reformat_with_column_width_option_added


NB. ====================================================================================================
NB. ====  (2/4) design of HTML doc  =======1
NB./*/HTML_TITLE/Text Reformater
NB./*/HTML_REMARK/multiple numbers in the textarea will be reformatted. table column size and integer column size are available. checklist for integer is available.

NB./*/HORIZONTALLINE
NB./*/TEXTAREA/00/VERTICAL/150/5/data input area /10 20 300 450 500 650 7 8
NB./*/HORIZONTALLINE
NB./*/DROPDOWN/00/VERTICAL/number of column of the table /6+6/12+12/1+1/2+2/3+3/4+4/5+5/6+6/7+7/8+8/9+9/10+10/11+11/12+12
NB./*/HORIZONTALLINE
NB./*/CHECKLIST/00/VERTICAL/3/number of integer  digits /6+6/8+8/10+10
NB./*/HORIZONTALLINE

NB. ====================================================================================================
NB. ====  (3/4) descrition of J function  =======
NB.define your J function(s) which will be used in YOUR_JOB function

NB. ============================================
replace_CRLF_with_space_in_str_y =: 3 : 0
v =. y
a_result =. ''
lineNo =. 0
total_Ln =. +/CRLF E. y
while. lineNo < total_Ln do.
 aLine =. take_one_line v
 print aLine
 a_result =. a_result, aLine, ' '
 v =. (2 + $ aLine) }. v  NB. drop line + CRLF(2 byte)
 lineNo =. 1 + lineNo
end.
a_result
)

NB. ============================================
reformat_number_list_str_to_matrix_of_column_size_x_str =: 4 : 0
NB.
NB. y is one string with multiple numbers with separator space
a_data =. ". y
a_column =. ". x
a_count =. #a_data
a_sho_int =. <. a_count % a_column
a_amari   =. a_column | a_count
if. a_amari > 0 do.
  tsuika_zero =. 0*i.(a_column - a_amari)
  a_data =. a_data, tsuika_zero
  a_result =. ((a_sho_int +1), a_column)$a_data
else.
  a_result =. (a_sho_int, a_column)$a_data
end.
a_result
)

NB. ====================================================================================================
NB. ====  (4/4) desctiption of your job based on POSTed data as argument of J function =======
YOUR_JOB =: 3 : 0
a_collection =. monitor_entry_ID_values 0 NB.extraction of POSTed data
reply_msg =. 'operation done without error'
reply_msg =. reply_msg, CRLF, CRLF
reply_msg =. reply_msg, a_collection

try. NB. -----
NB. contents of this textarea will be saved in try. block of YOUR_JOB function
a_given_data_str  =. TEXTAREA_00_VALUE, CRLF
a_table_column    =. DROPDOWN_00_VALUE

a_number_column   =. CHECKLIST_00_VALUE
a_integer_column  =. CHECKLIST_00_VALUE

print a_given_data_str, CRLF

a_given_data_str_CRLF_replaced_with_space =: replace_CRLF_with_space_in_str_y a_given_data_str

a_reformated_data =: a_table_column reformat_number_list_str_to_matrix_of_column_size_x_str a_given_data_str_CRLF_replaced_with_space

a_format =.  a_number_column,'j','0', '": '
a_reformat_cmd =. a_format,' ', 'a_reformated_data'
a_reformated_data_revised =. ". a_reformat_cmd
print 'a_reformat_cmd = ', a_reformat_cmd

NB. this is a matrix with at least one row with column number specified in dropdwon 00
NB. and each atom is formatted integer column szie only fraction column size is set in the checklist 01 but not used in this version

a_reformated_data_revised  save_array_number_data_as_text_file 'reformated.txt'

a_result =. rff 'reformated.txt'
print a_result, CRLF

reply_msg =. reply_msg, CRLF, a_result

catch. NB. -----
reply_msg =. 'error occured during the operation'
end. NB. -----
reply_msg
)
NB. end of creation
