Filtering data from a .txt file into a spreadsheet (new to programming)

I’ve got an index of 600+ item codes from a game, and I only need 2 pieces of information, which need to be placed into parallel cells in a spreadsheet.

Sample text: 


                                “ReID” “4049”


                                {“particle” “particles/item/rare_ambient.vpcf”}

                                “BaseClass” “item_lua”

                                “ScriptFile” “Abilities/items/lua_items.lua”

                                “EquipmentFlavour” “lightsword”}

What I need:


“ReID” “4049”

Is there a way for a script to read the first 6 characters of a line, match with "item_, then take the rest of the line

Then look for “ReID” match, and print the rest of that line also?

You don’t tell us what O/S or scripting mechanism you want to use.

For instance, in a Windows command line window, the following command will output the two target lines, based on your input sample:

findstr "item_ ReID" foo.txt | findstr /V "item_lua"

The findstr command has some support for regex.

1 Like