• Welcome to the new COTI server. We've moved the Citizens to a new server. Please let us know in the COTI Website issue forum if you find any problems.
  • We, the systems administration staff, apologize for this unexpected outage of the boards. We have resolved the root cause of the problem and there should be no further disruptions.

Recommend App for SEC Read/Edit

SpaceBadger

SOC-14 1K
Knight
Can someone recommend for me an app for very simple reading and editing of SEC files?

I have some files from Travellermap that I'd like to work on for my Reaver's Deep campaign. I need to do 3 things:

1) zero out all of the pop/govt codes;

2) replace world names with hex designations;

3) individually edit back in the world names and pop/govt codes that I want.

I could do all of this w Simon Hibbs's StarBase program, except for one thing: it doesn't seem to import from SEC, and I don't want to enter all of those systems by hand if I can avoid it!


Edit: Now trying to balance out which would take longer and be more annoying, putting every system in by hand, or writing a perl script to read the SEC files and break up the UWP and PBG into single digits in CSV format as seems to be required for StarBase. :(

Edit2: No, the quickest way for me to do it myself would be to go into town to get my office laptop w MS Access, import the SEC into Access, write a query to split up the UWP into individual digit fields, then export as CSV for use in StarBase.
 
FWIW, this is one reason learning JavaScript is worthwhile. Fire up a web browser, go to about:blank then pop open the JS console.

Code:
var ta = document.createElement('textarea'); document.body.appendChild(ta);

Paste your data into the textarea that has appeared.

Code:
var lines = ta.value.split('\n');

Now lines is an array of the individual lines. To zero out the non-physical UWP fields:

Code:
lines = lines.map(function(s) { return s.replace(/[ABCDEX](\w\w\w)\w\w\w-\w/, "X$1000-0"); });

To put it back into the text area so you can copy/paste:

Code:
ta.value = lines.join('\n');

Handling names, etc, is left as an exercise for the reader.
 
Thanks! I ended up doing it in MS Access - didn't take long, other than the trip to town to get my office laptop.
 
Back
Top