0

I am using libreoffice and would like to create USERNAME from initials of firstname lastname entries in csv file.

my csv file contains many names so the usernames need to be created automatically in Spreadsheet, like Firstname,Lastname Joe,Miller, so here the username would be jomi.

any help would be nice. thanks.

Ali
  • 534
  • 1
    See http://askubuntu.com/questions/719196/importing-users-that-will-be-installed-by-programs/719202#719202 for an example on how to do this. You need a bit more than just a username though. – Rinzwind Jan 25 '16 at 10:22

1 Answers1

2

If the CSV file looks like this:

Firstname,Lastname
Joe,Miller

Then open it up in Calc. In cell C1, enter this formula:

=LOWER(LEFT(A1,2) & LEFT(B1,2))

Then use the square in the lower right corner of cell C1 to fill the formula down the C column. Results:

fila
jomi

If there are thousands of rows, then it may be easier to select the entire C column by clicking on the C column heading, then Edit -> Fill -> Down.

Jim K
  • 1,413
  • when I enter this "=LOWER(LEFT(A1,2) & LEFT(B1,2))" in C1 it automatically adds 0 after A1 and B1 like this "=lower(left(A10,2) & left(B10,2))" – Ali Jan 25 '16 at 19:21
  • I have no idea why it would do that, and it did not when I tried it. But just delete the added 0's and it should work. – Jim K Jan 25 '16 at 19:30
  • my calc default language is Swedish if that helps. – Ali Jan 25 '16 at 19:41
  • BINGO its working, I've changed libreoffice language to English and it worked, its weird that I had to change the language but I am glad its working. thank you friend. – Ali Jan 25 '16 at 19:55