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