primer commit

This commit is contained in:
luis.garcia104
2026-09-22 17:42:27 +02:00
commit 47675b599b
11 changed files with 120 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk-27">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
+17
View File
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Fichero_01</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
@@ -0,0 +1,13 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=26
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=26
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=26
Binary file not shown.
+8
View File
@@ -0,0 +1,8 @@
/**
*
*/
/**
*
*/
module Fichero_01 {
}
@@ -0,0 +1,47 @@
package org.palomafp.aadd.LMGA;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
public class AppPrincipal {
public static void main(String[] args) {
String fichero = "C:\\Users\\alumnoT\\aadd\\fic01\\informacion_paises.txt";
try (BufferedReader br = new BufferedReader(new FileReader(fichero))) {
String linea;
while ((linea = br.readLine()) != null) {
linea = linea.trim();
if (linea.isEmpty() || linea.startsWith("#")) {
continue;
}
String[] campos = linea.split(",");
if (campos.length == 4) {
String codContinente = campos[0].replace("\"", "").trim();
int idPais = Integer.parseInt(campos[1].trim());
String nombrePais = campos[2].replace("\"", "").trim();
String capital = campos[3].replace("\"", "").trim();
String sql = String.format("INSERT INTO T_PAIS VALUES ('%s', %d, '%s', '%s');",
codContinente, idPais, nombrePais, capital);
System.out.println(sql);
}
}
} catch (IOException e) {
System.err.println("Error al leer el archivo: " + e.getMessage());
} catch (NumberFormatException e) {
System.err.println("Error al formatear un valor numérico: " + e.getMessage());
}
}
}
BIN
View File
Binary file not shown.
+23
View File
@@ -0,0 +1,23 @@
# Información de países
# Se muestra información del código de continente, identificador de país, nombre del país junto con su capital
"01",1, "Angola", "Luanda"
"02",62, "Brasil", "Brasilia"
"02",63, "Canadá", "Ottawa"
"02",64, "Chile", "Santiago De Chile"
"02",65, "Colombia", "Bogotá"
# Otra lista de países
"03",92, "Afganistán", "Kabul"
"03",93, "Arabia Saudita", "Riad"
"03",105, "Filipinas", "Manila"
"03",106, "India", "Nueva Delhi"
"03",136, "Vietnam", "Hanoi"
"04",147, "Bulgaria", "Sofía"
"04",152, "España", "Madrid"
"04",181, "Suecia", "Estocolmo"
# La parte final de países
"04",182, "Suiza", "Berna"
"05",185, "Australia", "Canberra"
"05",186, "Fiyi", "Suva"
"05",187, "Islas Marshall", "Majuro"
"05",196, "Tonga", "Nuku'alofa"
"05",197, "Tuvalu", "Funafuti"