Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi
I am working on an Amazon dataset which does not follow the traditional row and column format. Kindly advice on the best way to convert this into a easily manipulatable dataset in R.

Thank you

Dataset:

https://drive.google.com/file/d/1ruJKO-C1_PTLtulyPWsvoufJB6yX7vdx/view?usp=sharing

What I have tried:

Trying read.table("Software.txt") returns the error:

Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec, :
line 1 did not have 6 elements
Posted
Comments
Richard MacCutchan 24-Oct-21 3:50am    
Looking at the content it would appear that each 'item' in the file is a title/keyword and a text string, separated by a colon character. So knowing that you should be able to read it into some structure of your own.

Note: the review/text item may contain multiple lines of text, and is followed by a blank line which I assume is used as a section separator.
Kevin Paul 2021 24-Oct-21 9:49am    
Hi!
Thank you so much for replying. I am a complete beginner to R, so I'm not sure I understand your explanation. Could you kindly provide some code or point me to resources that describe how to solve this problem?
Thanks in advance!
Richard MacCutchan 24-Oct-21 9:56am    
Sorry I do not know R at all. I was just explaining the structure of the file, and how to read the items. If you are a complete beginner then I suggest you forget about this, go and find a good online tutorial (not YouTube) or book, and study the language.

Here is a useful link: CRAN: Manuals[^].
Maciej Los 26-Oct-21 15:39pm    
read.table function - RDocumentation[^] has several input parameters. Use them.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900