2011/7/29 Koen van Steekelenburg <koenvansteekelenb...@gmail.com>:
> Dear readers,
>
> I have a document(csv converted to spreadsheet) with bankstatements. Those
> statements have a date in the form of YYYYMMDD (no /'s or -'s). The problem
> is that I can't make libreoffice recognise those numbers as dates. Can
> somebody explain how I can make Libreoffice recognise the YYYYMMDD numbers
> as dates.
>
> Kind regards,
> Koen
>
> --
> Unsubscribe instructions: E-mail to users+h...@global.libreoffice.org
> Problems? 
> http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
> List archive: http://listarchives.libreoffice.org/global/users/
> All messages sent to this list will be publicly archived and cannot be deleted
>
>

I would do a search and replace as follows:

Highlight the cell range with the numbers that you want to convert to dates.
Open the search and replace dialogue.

Make sure that ”Regular expressions” is checked (you need to press the
”More options” button first).

Search for:
^([:digit:]{4})([:digit:]{2})([:digit:]{2})$

Replace with:
$1-$2-$3
or
$1/$2/$3
or
$3/$2/$1
or whatever format you'd prefer.

Hit ”Replace all” or search and replace them one by one.

I just tested this on my system (language=Swedish, country=Sweden). I
entered 20110729 in one cell and then replaced
^([:digit:]{4})([:digit:]{2})([:digit:]{2})$ by $1-$2-$3.
The cell displayed 11-07-29 (since the default date format on my
system seems to be YY-MM-DD) and in the formula field I could read
2011-07-29, as expected.


Regards

Johnny Rosenberg
ジョニー・ローゼンバーグ

-- 
Unsubscribe instructions: E-mail to users+h...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Reply via email to