How to remove non-AlphaNumeric character from LibreOffice Calc(generated by a Java Program) cell

StackOverflow https://stackoverflow.com/questions/19617390

  •  01-07-2022
  •  | 
  •  

سؤال

I am using a Java program to extract the values from a SQLite file and storing them into an excel(.xls) file on UBUNTU.

As shown in snapshot, when integer values are store in the excel sheet a special character (') is being appended to the values(see formula bar in image) and hence values are being stored as String instead of int. Because of which I am not able to make chart using these values.

enter image description here

The java function I am using in the program is -

photoInfo.add(resultSet.getString(h));

photoInfo is an arrayList and have no function to add integers.

I already tried formatting the cell as integer but of no use.

This character(') only appears in formula bar and is not visible in excel cell.

Can someone please suggest how can I remove this non-alphanumeric character from all the values in one go. Please provide code in StarBasic (not in VBS) if any is available?

هل كانت مفيدة؟

المحلول

Make a new column.
Use formula

=$A1+0 

enter image description here

and now extend this formula to all cells.

This is weired but works. And ofcourse is the most quick method I searched so far.

نصائح أخرى

Once the spreadsheet has been set up and you are ready to make charts, run this tiny VBA macro:

Sub tic_killer()
For Each r In ActiveSheet.UsedRange
    If r.PrefixCharacter = "'" Then
        r.Value = r.Value
    End If
Next
End Sub
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top