Another Great Tip from Kobi

kobayashi

Deity
Joined
Feb 15, 2001
Messages
2,709
Location
Singapore
Ever want to extract the names of items from the rules.txt but was thwarted by the trailing details?

I just figured out how to do it.

Copy the entire list (like all improvements) and paste into MS Word.

Use search and replace and replace two spaces with nothing - this will get rid of all the empty spaces.

toggle the invisible elements to on and press tab once. You will see an arrow. Copy this into the clipboard.

Now search and replace all commas with the arrow.

When you have finished, you should be able to paste the entire tab delimited text into MS Excel and have all the names appear in the first column.
 
MS Excel is a brilliant editing tool; especially for tech trees. You can open the rules.txt file as a CSV (comma seperated value) file for a similar effect.
 
It used to be in the good old days that you could paste into Lotus-123 as a comma delimited file but that can't be done in MS Excel (which also does not support key-stroke macros).

Anyway, do you mean just drag the rule.txt onto the excel icon and it will open as a CSV file automatically? That would be so much easier. Sh!t, I wish I knew about that a few years ago.
 
It isn't that automatic:

1) Open Excel
2) Open Rules.txt file
3) Choose "Delimited" Data
4) Choose "Comma" Delimited

Don't sweat it...I only found out about it this year.
 
Or: rename the rules.txt to rules.csv and then double-click on it.
 
The following single line of VBA code opens a Rules.Txt as csv and places the values in a sheet. Took about 30s to generate using Excel's macro recorder.

Workbooks.OpenText Filename:= _
"C:\GAMES\MPS\Test of Time\$cenario\Playtest\Lawrence\Rules.txt", Origin:= _
xlWindows, StartRow:=97, DataType:=xlDelimited, TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=True, _
Comma:=True, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 2), _
Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1))

Just change the filename to suit your needs. This one starts the import at line 97, the first line of data in @Civilize in this Rules file.
 
Back
Top Bottom