Page 1 of 1

CSV un-splitter

Posted: Sun Jan 20, 2008 1:59 am
by lodilefty
Sounds crazy, but does anyone have anything that can read files and rebuild a csv? :tournepas

For example, read all .mdl files in a directory and put them into a csv.

I'm looking to build/rebuild a database for some old mods that the database appears to be unavailable, or was never used (direct ASCII file editing was common in some cases...)

Posted: Mon Jan 21, 2008 5:22 pm
by Pocus
There is no such utility. You would need a volunteer coder I think for that. Not a too big stuff to do though.

Posted: Mon Jan 21, 2008 6:29 pm
by lodilefty
Pocus wrote:There is no such utility. You would need a volunteer coder I think for that. Not a too big stuff to do though.


Too big for me!!!! :bonk:

Any volunteers? :innocent:

Specifically: read each file in a 'models' directory and a the data to a spreadsheet or csv file such that each .mdl file becomes a line entry
Do same thing for .uni directory.

Reason: some mods were done directly into the text files, and rebuilding a datanbase manually is a pain and very error prone.....

Posted: Wed Jul 09, 2008 7:14 pm
by FM WarB
I was going to ask the same question. The reason is that it seems a whole lot easier to just copy a model file, rename and number, change a factor or two, and voila, you have a new model.
None of the .xls to cvs splitter rigamarole. Use the mod enabler and original files are saved; plug in yer new mod when you need it.

Posted: Wed Jul 09, 2008 7:30 pm
by lodilefty
FM WarB wrote:I was going to ask the same question. The reason is that it seems a whole lot easier to just copy a model file, rename and number, change a factor or two, and voila, you have a new model.
None of the .xls to cvs splitter rigamarole. Use the mod enabler and original files are saved; plug in yer new mod when you need it.


OK, unless you are doing a massive change.... :nuts:

Either works, of course. Wherever you are comfortable :)

Any aspirations to have a mod be 'official' will most likely require the xls file be updated and included...

Posted: Wed Jul 09, 2008 7:31 pm
by Stwa
FM WarB wrote:I was going to ask the same question. The reason is that it seems a whole lot easier to just copy a model file, rename and number, change a factor or two, and voila, you have a new model.
None of the .xls to cvs splitter rigamarole. Use the mod enabler and original files are saved; plug in yer new mod when you need it.


What you mentioned works best when you are just modding things basically one at a time.

But for instance, I would rename all the graphic files, and so I would quickly go through the spreadheet searching and replacing the names. Then generate all the model and unit files, in seconds.

Posted: Wed Jul 09, 2008 7:39 pm
by lodilefty
Exactly. :king:

Or if you want to change the TQ or Hits for all models of a class [say, US Infantry types in 1812 :siffle: ]

Once you've done csv/splitter a few times, it 'feels' quicker than text editing.

I wouldn't call it a rigamarole, but rather a multistep process.... :)
...better than many of Willy Gates fine software.. :niark:

Posted: Wed Jul 09, 2008 7:48 pm
by Nikel
Sorry for posting here as to be honest I am not sure what are you talking about :niark:


But what you want is something like this?

http://www.snapfiles.com/get/csvdb.html

Posted: Wed Jul 09, 2008 8:06 pm
by Primasprit
Nikel wrote:Sorry for posting here as to be honest I am not sure what are you talking about :niark:


But what you want is something like this?

http://www.snapfiles.com/get/csvdb.html


Thanks, but this is a csv editor. We use Open Office or Excel for this. :)
The original request was to have a tool which makes spreadsheet files (csv) from all the single model files. But I think we can agree on the fact that it is better to edit the DB files directly anyway. :sourcil:

Cheers
Norbert

Posted: Wed Jul 09, 2008 8:15 pm
by Gray_Lensman
deleted

Posted: Wed Jul 09, 2008 8:22 pm
by Gray_Lensman
deleted.

Posted: Wed Jul 09, 2008 8:23 pm
by Nikel
Sorry, as I said I have no idea of what you talk :innocent:

And this one? Could not try it as apparently you have to be logged to download files


http://www.codeproject.com/KB/database/FinalCSVReader.aspx

Posted: Wed Jul 09, 2008 9:45 pm
by lodilefty
To clarify: Way back in January, I wanted to take someone's mod and convert it into an xls Database file so that I could make mass edits, changes, etc...

Since I originated this request, it has become clear to me that anything specially written to do this would need to be updated frequently as AGEOD improves the games [adding parameters]

Anyway, to be clear:
I was looking for something that would:
  • Read an entire directory of text files that are all a similar format/data content [example: read all the model files in Clovis ACW mod :king: ]
  • Convert the data contained from those into a single csv [or ideally xls] file


I would be OK if it created a csv, as Excel [=Open Office] can import csv into xls quite nicely...

It would be helpful [to me, anyway] to capture some of the early 'pre-excel' mod work that is out there.... :coeurs:

Posted: Wed Jul 09, 2008 10:02 pm
by Stwa
Gray_Lensman wrote:Also, I don't think just making a .CSV file would solve the original question anyhow, To be really useful, it would have to be able to go all the way back to .xls format, as AGEod keeps the DB files in .xls format and not .csv format.


Good point!

Posted: Wed Jul 09, 2008 10:12 pm
by Nikel
OK, my last try. But it is not free and looks like very simple

http://www.sobolsoft.com/excelcsv/

Posted: Wed Jul 09, 2008 10:27 pm
by FM WarB
lodilefty wrote:
Anyway, to be clear:
I was looking for something that would:
  • Read an entire directory of text files that are all a similar format/data content [example: read all the model files in Clovis ACW mod :king: ]
  • Convert the data contained from those into a single csv [or ideally xls] file

I would be OK if it created a csv, as Excel [=Open Office] can import csv into xls quite nicely...

It would be helpful [to me, anyway] to capture some of the early 'pre-excel' mod work that is out there.... :coeurs:


It would also be helpful for certain tasks, using the mod enabler that can be done more easily than the Open Office-> spliiter method. For example, I just want to make a few Setup changes...do I need to cvs split events and cities, go through that rigamarole?

Lets say I come up with something good, or just prefer editing text files. I guess, "I don't want my mod to become Official."

Posted: Wed Jul 09, 2008 10:33 pm
by lodilefty
FM WarB wrote:It would also be helpful for certain tasks, using the mod enabler that can be done more easily than the Open Office-> spliiter method. For example, I just want to make a few Setup changes...do I need to cvs split events and cities, go through that rigamarole?

Lets say I come up with something good, or just prefer editing text files. I guess, "I don't want my mod to become Official."


As I said, the only rule is: xls to be official.

Mod away..... :nuts:

Posted: Thu Jul 10, 2008 12:21 am
by FM WarB
Nikel,
This is a "Reverse Engineering" issue. If you are doing the mod Yourself, you can save the .cvs or.xls files and refer to them all you want. If you only have the final, game readable files you canot convert them back into .cvs or .xls.

If you choose to mod any other way than starting from .xls files, your mod can never become official
Warren

Posted: Thu Jul 10, 2008 9:34 am
by Pocus
You can do a generic util, which would work even if we at ageod's add columns.

How it would work:

1. create a template file (permanent unless you edit it to add columns), listing all legit columns to add in your csv, one line per column to create. Load it into your program, as the list of legit columns.

2. read the directory, one file at a time

3. Add in your data structure the list of columns each separated by a semi-colon (this will be your header, ie the line 0 in excel with columns names)

4. for each file, iterate thru all legit columns of the template. If there is an entry in the file, add the value, if not, add NULL. Then add a semi-colon. This guarantee that each entry has the same number of data, in the right order.

5. Once all files are checked, save the result in a text file with a .csv extension.

An interesting exercise for would-be Delphinauts :sourcil:

Posted: Thu Jul 10, 2008 9:38 am
by Pocus
Say that your template is made like this: UID;Name;CombatValue

If you have a model with these entries:
UID = 0
Name = Infantry
CombatValue = 12

then you add 0;Infantry;12

if your model has these entries:

UID = 1
Name = Supply

then you add: 1;Supply;NULL

Your final output is then

UID;Name;CombatValue
0;Infantry;12
1;Supply;NULL