Converting text file for import into AMC
Converting text file for import into AMC
I've offered to convert my brother's list of films into an AMC database for him.
Most of the entries are like this:
Mondo Trasho (1969) (87 mins)
or with the format as well like:
Ruth, Roses & Revolver (1987) (WMV) (48 mins)
although there's quite a few that don't fit either, which have no Year information for example. There's quite a few which are TV programmes rather than films as well, so a lot of those probably won't be found when grabbing from IMDB, but he can delete these later if he wants.
What I need to do is convert the list into a CSV so that I can import it into AMC, so I'd be grateful for any advice on the easiest way to do this.
Most of the entries are like this:
Mondo Trasho (1969) (87 mins)
or with the format as well like:
Ruth, Roses & Revolver (1987) (WMV) (48 mins)
although there's quite a few that don't fit either, which have no Year information for example. There's quite a few which are TV programmes rather than films as well, so a lot of those probably won't be found when grabbing from IMDB, but he can delete these later if he wants.
What I need to do is convert the list into a CSV so that I can import it into AMC, so I'd be grateful for any advice on the easiest way to do this.
-
- Posts: 744
- Joined: 2007-04-28 05:46:43
- Location: Italy
Re: Converting text file for import into AMC
from your examples:
2) change ' (' to ';' with the apposite command
3) change ' mins)' to ';'
4)..... so on
5) save your file as .csv
now your file .csv can be opened with Excel (or other program you use):
6) open it and check that all titles are in the same column, idem for movie length, kind of codec etc. If not, make needed modifications and save at last your file as .csv.
7) open AMC
8) import from CSV file
is it clear???
P.S.
You don't need separated lines but fields separated by commas (or semicolons, it depends on your system).
1) Open your movies' list with notepad (it is in .txt format, isn't it?)Mondo Trasho (1969) (87 mins)
Ruth, Roses & Revolver (1987) (WMV) (48 mins)
2) change ' (' to ';' with the apposite command
3) change ' mins)' to ';'
4)..... so on
5) save your file as .csv
now your file .csv can be opened with Excel (or other program you use):
6) open it and check that all titles are in the same column, idem for movie length, kind of codec etc. If not, make needed modifications and save at last your file as .csv.
7) open AMC
8) import from CSV file
is it clear???
P.S.
You don't need separated lines but fields separated by commas (or semicolons, it depends on your system).
-
- Posts: 744
- Joined: 2007-04-28 05:46:43
- Location: Italy
Antp's and Bad4u's words are deeply true.
Anyway, if you expect to extract informations from IMDB, only information you need is original (or translated) title, so most important thing is to isolate it from others informations and this looks to be easy as, using your examples, this is always first information before '('....
Anyway, if you expect to extract informations from IMDB, only information you need is original (or translated) title, so most important thing is to isolate it from others informations and this looks to be easy as, using your examples, this is always first information before '('....
Thanks for the tips but by the time I'd learnt how to write a script to do it, I could have probably done it manually several times, so that's what I did in the end
It didn't really take too long cutting and pasting in OpenOffice Calc, to swap around some of the columns where the Codec/Length were the wrong way round, just a bit tedious really. I might look at writing a script if I need to do anything similar in future, but hopefully I won't need to!
It didn't really take too long cutting and pasting in OpenOffice Calc, to swap around some of the columns where the Codec/Length were the wrong way round, just a bit tedious really. I might look at writing a script if I need to do anything similar in future, but hopefully I won't need to!
-
- Posts: 744
- Joined: 2007-04-28 05:46:43
- Location: Italy
why do you still say you would need a script?doveman wrote:Thanks for the tips but by the time I'd learnt how to write a script to do it, I could have probably done it manually several times, so that's what I did in the end
It didn't really take too long cutting and pasting in OpenOffice Calc, to swap around some of the columns where the Codec/Length were the wrong way round, just a bit tedious really. I might look at writing a script if I need to do anything similar in future, but hopefully I won't need to!
You had only to:
1) Open your movies' list with notepad (it is a .txt or even .csv, it's the same). format, isn't it?)
2) change ' (' to ';' with the apposite command
3) save your file as .csv
now your file .csv can be imported into AMC catalog (all translated/original titles are in the same column, ins't it?)
Well not all the fields were in the same column as you can see from the two examples I gave in my first post. I wanted to keep the Format and Length (and Comments, although there weren't many of those) as my brother will probably prefer to see the length of the actual files he's got rather than the nominal one from IMDB. So a script might be useful to put the Format, Length and Comments in the correct fields.
I think I've done all the movies now but there's a load of documentaries which I think I'll make a separate AMC catalog for and try a script with those maybe (if I can work it out!).
Then there's a load of music videos, tv episodes, DVD extras, etc which I'm not sure AMC can do anything with, but if I so I might want to use a script on those as well.
I think I've done all the movies now but there's a load of documentaries which I think I'll make a separate AMC catalog for and try a script with those maybe (if I can work it out!).
Then there's a load of music videos, tv episodes, DVD extras, etc which I'm not sure AMC can do anything with, but if I so I might want to use a script on those as well.
To help illustrate the issue with importing the list of documentaries, here's a sample of entries.
Autoschreck / Car-Fright (1994) (MP4/AVI) (16 mins)
Francis Bacon – South Bank Show 1985 (MPG) (55 mins)
The Battle For Jerusalem (Storyville 14.5.08) (49 mins)
The Century Of The Self (4 parts) (58/59/59/59 mins)
Finally Got The News (56/26 mins)
As you can see, after the titles some have (Year) (Format) (Length), some have (Format) (Length) and some just have (Length) and some have (Programme/Channel Date) although thankfully there's not too many of those as they'll probably have to be adjusted manually.
I imagine a script should be able to identify the Length as being in the brackets with the word mins and the Format can be identified from a list of possibles, whilst the Year can be identified as a four-digit number beginning with 19 or 20. It's not too bad importing the list into OpenOffice Calc, using the "(" as separator and then just replacing the ")" with blanks, although I'd need to manually move certain bits (such as Storyville or 4 parts) back on the end of the title first.
Autoschreck / Car-Fright (1994) (MP4/AVI) (16 mins)
Francis Bacon – South Bank Show 1985 (MPG) (55 mins)
The Battle For Jerusalem (Storyville 14.5.08) (49 mins)
The Century Of The Self (4 parts) (58/59/59/59 mins)
Finally Got The News (56/26 mins)
As you can see, after the titles some have (Year) (Format) (Length), some have (Format) (Length) and some just have (Length) and some have (Programme/Channel Date) although thankfully there's not too many of those as they'll probably have to be adjusted manually.
I imagine a script should be able to identify the Length as being in the brackets with the word mins and the Format can be identified from a list of possibles, whilst the Year can be identified as a four-digit number beginning with 19 or 20. It's not too bad importing the list into OpenOffice Calc, using the "(" as separator and then just replacing the ")" with blanks, although I'd need to manually move certain bits (such as Storyville or 4 parts) back on the end of the title first.
You can execute this script to trim all fields.
Code: Select all
program TrimAllFields;
uses
SoulSnakeUtils;
var
i: Integer;
begin
for i:=0 to GetFieldCount+GetCustomFieldCount-1 do
begin
SetFieldOrCustomField(i, Trim(GetFieldOrCustomField(i)));
end;
end.
Arf, it is not included in package.
You can find it here: http://mickaelvanneufville.online.fr/AMCU/scripts/
Just copy SoulSnakeUtils.pas in Scripts folder.
Soulsnake.
You can find it here: http://mickaelvanneufville.online.fr/AMCU/scripts/
Just copy SoulSnakeUtils.pas in Scripts folder.
Soulsnake.
Last edited by soulsnake on 2012-01-04 11:43:09, edited 1 time in total.