Getting information from a source file and displaying in an easy to use table

FootyMan

New Member
Joined
Aug 26, 2013
Messages
10
Hi,

Many years ago I requested help on a very basic table I had that was made much better by users here, and that I still use to this day. I was hoping to see if the following is possible in excel (I'm not sure if it's actually too complex).

I am trying to get excel to pull information from a source document (but that isn't formatted in excel), and then display it in an easier to read table (in excel) - which I can then manipulate as required. The issues are that the source document isn't really uniform, so I have to search out the items required, and that it's very manual, and I'd like to be able to add some customisability. The actual document is longer and has many ids and variables (not helpfully named - hence requiring customisability to add these but also output these usefully) - In the example I've provided I've tried to change the variables to provide a game style example.

Really appreciate any help on this, or letting me know if it's even possible.

I couldn't find how to add the workbook (I assume for security) so I have just added images.
 

Attachments

  • Data Sheet Source EG1.png
    Data Sheet Source EG1.png
    52.9 KB · Views: 14
  • Data Sheet Output EG2.png
    Data Sheet Output EG2.png
    111.3 KB · Views: 14
  • Data Sheet Notes EG3.png
    Data Sheet Notes EG3.png
    83.3 KB · Views: 14

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
You might consider using Power Query to get the data into excel. Click on the link in my signature for more information on PQ
 
Upvote 0
Hi, Thanks for your response.

I've had look through the Power Query guide you mentioned, it does look like it would be useful. I'm struggling on how to get my data to look like theirs though, if my source data looked like that I don't think I'd need guidance.

The issue I have is that I can't seem to figure out how to get the source to output to something like what they start with, they have columns etc labelled correctly, but I don't know how to get a long list like my source to sort to something like that. It's worth mentioning my example is just a game example using variables like strength or health, but the real data would have just a long list, with anywhere between 200-300 lines of variables - I'm just trying to be able to extract a list of around 20 of the variables, for each requested "hero" (which in the real data is just an id, but again a long list of these). In that guide it does mention it can be used for things over 1 million lines, in the end mine is only around 30,000 so I'm sure it's possible, but not sure how to start to go about it.
 
Upvote 0
Would something like this work?:
Here you can download the working file:
txtload.zip

from the data you provided:

IDVariableValue
id8name"Hero"
id8willpower52
id8int28
id8melee25
id8ranged15
id8str30
id8maxhealth50
id8temphealth50
id10busy1
id18name"Hero2"
id18willpower74
id18int35
id18melee40
id18ranged40
id18dex75
id18str20
id18maxhealth50
id18temphealth50


Power query code:
Power Query:
let
    Origen = Csv.Document(File.Contents("C:\Users\fstraube\Desktop\data.txt"),[Delimiter=",", Columns=1, Encoding=1252, QuoteStyle=QuoteStyle.None]),
    #"Filas filtradas" = Table.SelectRows(Origen, each ([Column1] <> "" and [Column1] <> "}")),
    #"Personalizada agregada" = Table.AddColumn(#"Filas filtradas", "ID", each if(Text.Contains([Column1], "{")) then Text.BeforeDelimiter([Column1],":") else null),
    #"Rellenar hacia abajo" = Table.FillDown(#"Personalizada agregada",{"ID"}),
    #"Filas filtradas1" = Table.SelectRows(#"Rellenar hacia abajo", each not Text.Contains([Column1], "{")),
    #"Personalizada agregada1" = Table.AddColumn(#"Filas filtradas1", "Personalizado", each Text.Trim(Text.AfterDelimiter([Column1],":"))),
    #"Texto extraído antes del delimitador" = Table.TransformColumns(#"Personalizada agregada1", {{"Column1", each Text.BeforeDelimiter(_, ":"), type text}}),
    #"Columnas reordenadas" = Table.ReorderColumns(#"Texto extraído antes del delimitador",{"ID", "Column1", "Personalizado"}),
    #"Columnas con nombre cambiado" = Table.RenameColumns(#"Columnas reordenadas",{{"Column1", "Variable"}, {"Personalizado", "Value"}})
in
    #"Columnas con nombre cambiado"

Let me know if this works for you.
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,196
Members
452,616
Latest member
intern444

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top