THanks Camelot for your time and care
I will try now to explain better
1st
My students send me plain text files devided in 3 parts each with a tab sign, there are no carriage returns in any text file.
The files they sent me only share the first tab properly the tab being the name of the film they discuss.
After receiving the files I add them to a BBedit text file which keeps the various tabs and can easily be imported in my FMP db which only has 3 fields: FileName -> Year -> Reference -> Carriage return
They also should send the year and then a reference in this order, however some do not.
In other words while the filename is always there and the first for all tab-text files I receive, some write the reference then tab and then the year.
Others simply send the filename
Others simply send the year so the file only has two tab files and importing it in FMP18 it will go in the 2nd field of the database.
Others only send the filename and the reference.
Importing the BBedit text file becomes very complex, as some fields in the records do not match the order required.
As the year is always a number with 4 digits this perhaps will help me to adjust the database so that each field has the same contente: text, for filename, number for the year, text for the reference.
I hope to be able to still import everything from the BB edit text file, with a script which
1st
moves the to the proper field if the student swapped the reference and the year in the wrong place
2nd
Places the year in the year field and moves to the next if the reference is missing
3rd
Places the refernce in the third field leaving the year empty if the year info is missing.
4th simply moves to the next record if they only wrote the filename.
This shouldn't be too hard as the year is always 4 digits from 1918 to 2021.
The reference is a text file with max 10 characters and none contains any digits
I hope this simplifies the chance to write a script if this is at all possible.
Thanks again for your time and care, but I am too old to do it manually and I am no longer famiiar with the improvements in FMP18
KInd regards