joint mutli ligne (one record) in a single line

22 views
Skip to first unread message

Linus_11

unread,
Jun 22, 2021, 7:26:01 AM6/22/21
to OpenRefine

Hi,

I would like to merge / join several data on the same row / record for a structure like this
<CRS>
   <CR>
       <CR_AUT display="KANTIREA (M.)" digest="KANTIREA (M.)" source="drant" table_name="DRANT_AUTEUR">23427</CR_AUT>
        <CR_TXT>AC, LXXX, 2011, PP. 517-519</CR_TXT>
         <CR_LNG display="French">12</CR_LNG>
    </CR>
<CR>
    <CR_AUT display="HALFMANN (H.)" digest="HALFMANN (H.)" source="drant" table_name="DRANT_AUTEUR">7723</CR_AUT>
     <CR_TXT>KLIO, XCIII, 2011, PP. 520-521</CR_TXT>
     <CR_LNG display="German">2</CR_LNG>
    </CR>
</CRS>

But i dont know how can i merge / joint  "autors" , "feedbck text", "text langage" to have only one row data.
I am a beginner in openrefine this my screenshot result

cr_data.png

Thank you for help !

Owen Stephens

unread,
Jun 22, 2021, 8:21:18 AM6/22/21
to OpenRefine
Hi,

Do you need to have a cell containing this text, or to create a file with the text in it? There are different approaches depending on the outcome you need

Best wishes

Owen

Mohammed Benkhalid

unread,
Jun 22, 2021, 9:11:30 AM6/22/21
to openr...@googlegroups.com
I want toi insert this data in database,
With a note who contain multi feedback 
First feedback / autor / text / language 
Seconde feed back 
I think autor 1 "separator" autor 2 in one column
And text 1 "separator" text 2 in another column

Etc 
To matching him in database as multivalues.

Thanks you !
Linus

--
You received this message because you are subscribed to the Google Groups "OpenRefine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openrefine+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openrefine/3cfb7d6d-b0b3-4038-9001-5d4a375123c8n%40googlegroups.com.

Owen Stephens

unread,
Jun 22, 2021, 9:44:00 AM6/22/21
to OpenRefine
I'm not sure I understand completely what you need to end up with - can you give an example of what this would look like for one of the data rows you've shared?

In general the first approach I'd consider is using the Export options

  • Click "Export" at the top right of the screen
  • Choose "Custom tabular exporter"
  • In the custom tabular exporter configuration "Content" tab check only the columns you want to export
  • In the custom tabular exporter configuration "Download" tab select the appropriate "separator" (you can put in the separator of your choice in the 'custom separator' option)
  • Click "download"
That would give you the data from each column with a common separator between each value

If this isn't going to achieve what you need, there are other options - let me know.

Owen


Mohammed Benkhalid

unread,
Jun 24, 2021, 11:26:05 AM6/24/21
to openr...@googlegroups.com
Hi Owen,
Thanks for your answer!

In my case, I have several lines with the same id but the values are on two lines
example
id | autor | hobbie | Country
------------------------------------
1 | johne | Tenis | France
------------------------------------
1 | Footbull | Spain

Here the same author is linked to several hobbies and the hobbies are each in one country.
I would like to join the hobbies and countries (Tenis | Footbull) in one field and (France | Spain)
and when I insert the data in my database I get

id : 1
Name: Johne
Sport: Tenis
Country : Spain
Sport : Footbull
Country : France

I don't know if I explained it well, my structure is complex! :( ...^^

Translated with www.DeepL.com/Translator (free version)

Owen Stephens

unread,
Jun 25, 2021, 4:33:17 AM6/25/21
to OpenRefine
Hi 

If I have understood correctly, you can do this using:

In the "id" column use "Edit cells" -> "Blank down" to create records
Make sure you are in "records" mode (at top left of data grid)
You should have a project like - note there is 1 record but 2 rows:
Screen Shot 2021-06-25 at 09.30.40.png
If you have the "autor" name in both rows, use "Blank down" on that column as well
Now on the "hobbie" column use "Edit cells" -> "Join multi-valued cells"
Do the same on "Country" column
You should have an outcome like:
Screen Shot 2021-06-25 at 09.31.51.png

Hope this helps!

Owen

Mohammed Benkhalid

unread,
Jun 28, 2021, 4:27:44 AM6/28/21
to openr...@googlegroups.com
Yes i thiks is the best solution for my problem, thank u ! thats will

Reply all
Reply to author
Forward
0 new messages