Convertir datos de TXT a SQL db

Aquí puedes preguntar o compartir tus dudas y conocimientos acerca del programa
Alguien tiene algún ejemplo de como poder convertir un txt a .db, cual el txt contiene así sus datos en cada linea:

01283|LUNES|ENTRADA|12:56|C:MIS IMAGENESFOTO 1.jpg|
01928|LUNES|SALIDA|1:34|C:MIS IMAGENESFOTO 2.jpg|01254
01827|VIERNES|ENTRADA|10:25|C:MIS IMAGENESFOTO 35.jpg|
01897|SABADO|SALIDA|2:20|C:MIS IMAGENESFOTO 78.jpg|

Deseo que el dato que contienen cada linea, guarde cada dato con la separación que tiene | es decir que cada dato de una linea se guarde en la db separando numero de control, dia, status, hora, imagen, alguien me puede ayudar a convertir los datos de un txt a db.
hi

tray used the same of that code :

Código: Seleccionar todo

tu_texto = "01283|LUNES|ENTRADA|12:56|C:MIS IMAGENESFOTO 1.jpg|"
for nChar in string.gmatch(tu_texto, "([^|]*)") do
 if nChar~="" then
     Dialog.Message("Notice", nChar, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
 end
end
si es lo que me ayuda, solo que no se como utilizar estos términos, si los deseara separar lo textos en varias input como seria?

tu_texto = "01283|LUNES|ENTRADA|12:56|C:MIS\IMAGENESFOTO 1.jpg|"
for nChar in string.gmatch(tu_texto, "([^|]*)") do
 if nChar~="" then
 Input.SetText("Input1", nChar)
     Dialog.Message("Notice", nChar, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
     
 end
end
¿Lo que solo me falta es como separar los datos cada uno en 5 input?

tu_texto = "01283|LUNES|ENTRADA|12:56|C:MIS IMAGENESFOTO 1.jpg"
for nChar in string.gmatch(tu_texto, "([^|]*)") do
 if nChar~= "" then
 Input.SetText("Input1", nChar)
 Input.SetText("Input2", nChar)
 Input.SetText("Input3", nChar)
 Input.SetText("Input4", nChar)
 Input.SetText("Input5", nChar)
 end
 end
GEORGEFTR escribió:¿Lo que solo me falta es como separar los datos cada uno en 5 input?

tu_texto = "01283|LUNES|ENTRADA|12:56|C:MIS IMAGENESFOTO 1.jpg"
for nChar in string.gmatch(tu_texto, "([^|]*)") do
 if nChar~= "" then
 Input.SetText("Input1", nChar)
 Input.SetText("Input2", nChar)
 Input.SetText("Input3", nChar)
 Input.SetText("Input4", nChar)
 Input.SetText("Input5", nChar)
 end
 end
oh ..... No
the right way as this Code :

Código: Seleccionar todo

tu_texto = "01283|LUNES|ENTRADA|12:56|C:MIS IMAGENESFOTO 1.jpg|"
a= string.gmatch(tu_texto, "([^|]*)")
i=0;
for nChar in string.gmatch(tu_texto, "([^|]*)") do
 if nChar~="" then
     i=i+1;
     Input.SetText("Input"..i, nChar);
 end
end
Muchas gracias me ayudo mucho, gracias por el tiempo dedicado, de verdad muchas gracias.