Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

229
Vistas
How can I edit a .dat file in JavaScript?

I want to be able to:

  • edit the data of a .dat file on my computer for a website.
  • pull data from the file to use it later on.

I know a tiny bit about javascript and heard javascript cannot directly edit databases.

Is a .dat file in my computer a database?

I have done a few things in Javascript for websites but I haven't done anything complicated completely myself. I created some websites before and I have a basic understanding of HTML and CSS.

Please phrase your response as simply as possible. Explain the meaning of any complicated but necessary terms.

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

You need some server-side script to access the filesystem of the server such as PHP or NodeJs...

You can reference this url.

Nodejs example here.

w3school link here.

let fs = require('fs');

Appeding file:

fs.appendFile('mynewfile1.txt', 'Hello content!', function (err) {
  if (err) throw err;
  console.log('Saved!');
});

Delete file:

fs.unlink('mynewfile2.txt', function (err) {
  if (err) throw err;
  console.log('File deleted!');
});

Rename file :

fs.rename('mynewfile1.txt', 'myrenamedfile.txt', function (err) {
  if (err) throw err;
  console.log('File Renamed!');
});

Read file :

fs.readFile('demofile1.html', function(err, data) {
    if (err) throw err;
    console.log(data);
});
about 4 years ago · Juan Pablo Isaza Denunciar

0

You can use PHP server code to resolve your problem.

Here is PHP file I/O example code.

File reading:

<?php
   echo file_get_contents("test.txt");
?>

File writing :

<?php
   echo file_put_contents("test.txt","Hello World. Testing!");
?>
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda