title: How do I change a certain part of a cell sqlite?
body: <p>I have a java program that saves revisions of files to a database. I am currently adding a function where I can change the name of the file in the DB. The problem is, each revision is saved in the format of Date@Time File_Name. For example "2019-1-24@1.34.55 File.pdf". All of the revisions are stored with the same file ID, so the same file can be found through the file ID no matter which revision it was. How do I update the name of the revisions, without altering the Date@Time part of the name. For example--change "2019-1-24@1.34.55 File.pdf" to "2019-1-24@1.34.55 NewFileName.pdf". </p>
  
  <p><a href="https://i.stack.imgur.com/zgKmv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zgKmv.png" alt="This is my table before my fileID query"></a></p>
  
  <p>The first step I feel like would be to select all rows that have the file ID I am looking for. </p>
  
  <pre><code>select name
  from allFiles
  where fileID = '1'
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/Fs3MT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Fs3MT.png" alt="This is after the fileID query, and it is showing all files with a File ID of 1. These are all revisions of the same document"></a></p>
  
  <p>This isn't hard, but now I would like to change all the file names how I mentioned above for each one of the files with that file ID. Thus, I will probably need to use a loop. Something like the one below. </p>
  
  <pre><code>WHILE @cnt &lt; cnt_total 
  BEGIN {...statements...} 
  SET @cnt = @cnt + 1; 
  END;
  </code></pre>
  
  <p>To summarize, I need to change the name of all files with a certain file ID. But when changing the name, only change the second part where the actual file name is and not change the date section.</p>
  
  <p>If it helps, the modified date that is in the first part of the name is also stored as its own column in the DB. But the date also needs to be in the name to prevent duplicates.</p>