Hi,
Since we must use a different method to have context sensitive help, I need to create a .flali and .hh files containing csh ids.
I have thousands of concepts to "convert" in CHSIDs. Create CSHid one by one will take a lot of time.
Is there anyone who has already done this? How did you do?
Thanks,
Editing .flali to add thousand of identifiers
-
MaryseCoutureSh
- Jr. Propeller Head
- Posts: 8
- Joined: Tue Nov 17, 2015 7:34 pm
-
wclass
- Propellus Maximus
- Posts: 1238
- Joined: Mon Feb 27, 2006 5:56 am
- Location: Melbourne, Australia
Re: Editing .flali to add thousand of identifiers
I use Excel and the file list to generate map IDs and alias files using the following steps. Basically, I get a list of the files using file list, then use Excel to generate mapIDs and build the data for the header and alias files. I then just copy the data from the generated columns and paste them into the Flare .h .flali files as needed.
To start with - here is how to generate the header file:
In Flare:
1. Open the File List - use View > File List.
2. Filter for just the HTML files - in general, these are the only ones that you will want a map ID for.
3. Export the list to Excel - actually your option is to create a CSV file, but you then open it in Excel.
In Excel:
1. Open up your FileList.csv file and save it as an Excel spreadsheet - it should contain a plain table of data with the file name, path, dates, etc.
Really, the only 2 fields you need are the file and path name, and you can ignore or delete the rest.
I normally delete a few columns so that I can see all columns on the one screen.Let's assume that the filename is in Column A.
2. Convert the data to an Excel table - put your cursor in the first field and select Insert > Table.
3. Add the following headings to the end of the table to create the header file:
a. MapID
b. WindowName
c. Define-line - this will end up as "#define windowName MapID"
4. For MapIDs - generate some numbers and let Excel fill in the sequence - gets a list of unique numbers.
5. Decide what name you want to give each entry - these names have to be unique. I generate from the file and path names, removing spaces and special characters. But this can leave a long name. If you know you don't have duplicates you can just use the file name. For this example, I concatenate the unique map id. You need a formula that will grab the file and path, concatenate them, and remove the spaces etc. This one removes the file extension, removes spaces, and replaces hyphens with underscores - you might need to clean up the window name if you have other characters. Then I add on the unique ID. Here I have the map ids in column G and the file name in column A:
=SUBSTITUTE( SUBSTITUTE( SUBSTITUTE(A2, ".htm", ""), " ", ""), "-", "_") & "_" & TEXT(G2, "000")
6. Now generate the #define line with your mapIDs and window name - this should fill down for the whole column. You need to put in the correct column numbers for the map and name fields - here I have them in G and H.
="#define " & H2 & " " & G2
7. Copy the #define column into the header file - *.h
To start with - here is how to generate the header file:
In Flare:
1. Open the File List - use View > File List.
2. Filter for just the HTML files - in general, these are the only ones that you will want a map ID for.
3. Export the list to Excel - actually your option is to create a CSV file, but you then open it in Excel.
In Excel:
1. Open up your FileList.csv file and save it as an Excel spreadsheet - it should contain a plain table of data with the file name, path, dates, etc.
Really, the only 2 fields you need are the file and path name, and you can ignore or delete the rest.
I normally delete a few columns so that I can see all columns on the one screen.Let's assume that the filename is in Column A.
2. Convert the data to an Excel table - put your cursor in the first field and select Insert > Table.
3. Add the following headings to the end of the table to create the header file:
a. MapID
b. WindowName
c. Define-line - this will end up as "#define windowName MapID"
4. For MapIDs - generate some numbers and let Excel fill in the sequence - gets a list of unique numbers.
5. Decide what name you want to give each entry - these names have to be unique. I generate from the file and path names, removing spaces and special characters. But this can leave a long name. If you know you don't have duplicates you can just use the file name. For this example, I concatenate the unique map id. You need a formula that will grab the file and path, concatenate them, and remove the spaces etc. This one removes the file extension, removes spaces, and replaces hyphens with underscores - you might need to clean up the window name if you have other characters. Then I add on the unique ID. Here I have the map ids in column G and the file name in column A:
=SUBSTITUTE( SUBSTITUTE( SUBSTITUTE(A2, ".htm", ""), " ", ""), "-", "_") & "_" & TEXT(G2, "000")
6. Now generate the #define line with your mapIDs and window name - this should fill down for the whole column. You need to put in the correct column numbers for the map and name fields - here I have them in G and H.
="#define " & H2 & " " & G2
7. Copy the #define column into the header file - *.h
Margaret Hassall - Melbourne
-
wclass
- Propellus Maximus
- Posts: 1238
- Joined: Mon Feb 27, 2006 5:56 am
- Location: Melbourne, Australia
Re: Editing .flali to add thousand of identifiers
Following on from the above, you can create the entries for the ALIAS file in another column.
The alias file (.FLALI) is XML starting with <catapult> type nodes. I usually create one on Flare with a dummy entry, then use the same spreadsheet as above to create the alias link lines and copy/paste them into the existing .FLALI file.
I want to generate a line for each mapID as follows:
<Map Name="home" Link="/Content/welcome.htm" />
So I need the window name as generated above, plus the concatenated path and file name but with the slashes the other way as generated by the file list. I also need to put in some double quotes which is a bit tricky but do-able.
So adding more columns to the above: …
1. Add a column called "Alias"
2. Put in the following (complicated) formula(s) - sometimes doing this in a few steps/columns is a bit easier.
3. To get just the full path name for the link - and put this in column J (or whatever you have in your table) - assumes path in B and filename in A:
="/" & SUBSTITUTE(B2, "\", "/") & A2
4. Now, to wrap that with the map name including the quote marks etc. (and you have the full path in J)
="<Map Name=" & """" & G2 & """" & " Link=" & """" & J2 & """" & " />"
And finally copy the results of that column and paste into the FLALI file you generated.
The alias file (.FLALI) is XML starting with <catapult> type nodes. I usually create one on Flare with a dummy entry, then use the same spreadsheet as above to create the alias link lines and copy/paste them into the existing .FLALI file.
I want to generate a line for each mapID as follows:
<Map Name="home" Link="/Content/welcome.htm" />
So I need the window name as generated above, plus the concatenated path and file name but with the slashes the other way as generated by the file list. I also need to put in some double quotes which is a bit tricky but do-able.
So adding more columns to the above: …
1. Add a column called "Alias"
2. Put in the following (complicated) formula(s) - sometimes doing this in a few steps/columns is a bit easier.
3. To get just the full path name for the link - and put this in column J (or whatever you have in your table) - assumes path in B and filename in A:
="/" & SUBSTITUTE(B2, "\", "/") & A2
4. Now, to wrap that with the map name including the quote marks etc. (and you have the full path in J)
="<Map Name=" & """" & G2 & """" & " Link=" & """" & J2 & """" & " />"
And finally copy the results of that column and paste into the FLALI file you generated.
Margaret Hassall - Melbourne