Every day, I get up to 25 real estate photoshoots from a photographer, edit them, and export them into their respective realtors' folder in Dropbox. I get each shoot from the photographer in a folder named with its respective address/location. Currently, after editing each shoot, I look at the foldername (the address/location), go to the Calendar app, find which event has that location, see who the respective realtor is, navigate to their personal folder or create it if it doesn't exist, and then export the photoshoot into their folder (the realtor's name). Every. Single. Time.
I'm trying to automate this process by simply exporting all the shoots into one folder, triggering an Automator Folder Action which sorts the shoots into their respective realtor's folder, based on the foldername.
The relationship between the source folders and destination folders is determined based on location data from a Calendar Event. I've already figured out how to pull the data from Calendar, but getting Automator to move the folders around using the data has me thoroughly stumped.
I've tried several things in Automator, and I'm sure there's a simple way using Applescript but I haven't learned enough about Applescript to make it work. I've tried copy/pasting bits of Applescript code from other posts but I've finally thrown my hands up and decided to ask the experts lol. Here are some screenshots to help illustrate the issue.
Folders full of pictures "Test"(Sources):
"Realtors" Folder (Destinations)
Here is the Automator Workflow I've created so far, which pulls the address (Source foldername) and realtor names (Destination foldername [with other junk to be removed]) from Calendar event data, and creates 2 txt files (shown in the screenshot after this one):
Text files created by above workflow:
It's possible that I'm overcomplicating this horribly, but the solution that comes to mind is this: The text files correlate based on line number, i.e. line 1 of "Today's Locations.txt" (Location: 326 Whiterock Dr) corresponds with line 1 of "Today's Shoots.txt" (Summary: Photos for Remy Locasio).
When I drop these folders into the trigger folder, "Test" in this case, Automator/Applescript could search the "Today's Locations.txt" file for "326 Whiterock Dr" and say, "Hey, that's on line 1. I'm gonna go into "Today's Shoots.txt",find line 1, parse out (Summary: Photos for ), take the realtor's name only (Remy Locasio) and move the input folder ("326 Whiterock Dr") into the realtor's folder with that name ("Remy Locasio"), then do it again for the next folder and it's corresponding documents' line, etc etc, until all the folders are moved.
Before the realtor's name is typically the word "for ". Whether it's Photos for , Photos and videos for , Photos and aerial photos for etc. so "for " could be a delimiter maybe?
Sometimes, after the realtor's name, there's a note, always separated by a " (", eg. Brandi Smith (text when on the way), so " (" could be another delimiter maybe?
Sometimes the realtor's name is spelled wrong in the calendar but not in the folder, as is the case with Brandi vs Brandy Smith on line 9. There would need to be a popup in this case asking for the correct folder. Something to the effect of "Could not find a folder called "Brandi Smith". Should we create it or choose another folder? and I'd choose the correct folder, or in the case of "Megan Forsberg" (line 8) who doesn't have a folder yet, allow it to create the folder.
I've racked my brain for a week trying to do this with Automator and variables and I'm at a complete loss, any help would be a godsend. I'll gladly clarify anything that doesn't make sense or answer any questions anyone has.
I can't understand the whole problem clearly but you can use below code in the applescript for the regex part.
set a to "Photos for Karie Williams (Zonker)"
set b to do shell script "str='" & a & "';sed 's/(.*//g' <<< $str"
set c to do shell script "inp='" & b & "';sed 's/.*\\(for \\)//' <<< $inp"
display dialog c
from google.colab import files
file = files.upload()
df = pd.read_csv('Book 1.xlsx')
df.head(10)
print(df['id'])
When I run this I get a key error for id, which is the first header name in my dataset.
I created this file in numbers by copy pasting text in csv format to a blank numbers spreadsheet and exporting as a csv file. I have "use header names as labels" on in preferences. I have recently gotten my MacBook so there may be some small detail I am overlooking. I have also tried removing footer rows but it isn't working. Please help.
Do you have the head as example because now we are just guessing. And also you are loading a .xlsx file with pd.read_csv while you have the pd.read_excel function in pandas. Maybe that helps?
Also Mohana's answer is worth trying. You are looking on a string and it can be different than you think.
I'm generating some CSV files from a ICEfaces application, simply writing on the HttpServletResponse.
All these files are correctly opened by OpenOffice, one of them can be opened by OpenOffice but not in Microsoft Excel. The error message is "The file format differs from the format that the file name extension specifies". If I try to go on it stops on row 106 saying "Unable to read row 106".
The file is named "blacklist.csv", the content type is "text/csv". Here's an excerpt of the file content:
ID;CodiceStazione;NomeStazione;Sensore;Inizio;Fine
49;"PU59";"Nipozzano";"LW";"2012-01-01 00:00";""
158;"PI01102365";"Belvedere";"AT";"2013-01-01 00:00";""
159;"PI01102365";"Belvedere";"LW";"2013-01-01 00:00";""
...
1439;"RP010";"Castelnuovo Scrivia";"RR";"2015-07-20 00:00";""
The last row is row 106, but is seems to me it is similar to the other rows.
Any suggestion?
Excel uses regional settings of the used operation system to open csv files. It depends on your system how to change it. Have a look here: https://superuser.com/questions/476327/how-do-i-save-an-excel-spreadsheet-as-a-semi-colon-separated-values-file
We have been programming an application for the next two weeks to make a valid csv file to import to Magento.
But, we have a problem with importing in general, as we get the error that Magento can't find the required columns: sku. I've been looking through a lot of forums.
I have seen it could be the visibility but we have that in our csv. I will give you an example of how our csv looks like:
sku,name,ean,manufacturer,price,msrp,tax_class_id,qty,_category,is_in_stock,status,description,_type,visibility,_attribute_set,color,geluidssysteem,platform_consoles,protection,connection,kabel_lengte,lader,nintendo_platform,model,megapixels,geschikt_foto_video_tas,schermdiagonaal,size,keyboard_layout,geheugen,draagstijl_headset,materiaal,type_camera,type_toetsen,left_right_handed,vermogen,toetesenbord_verlicht,sensorkeuze,stroom_voorziening,connection_mouse,
MRM-01855,AA FUSION AUDIO 3.5mm to 3.5mm Jack kabel 1 meter wit,5060166512163,Advanced Accessories,3.18,,2,6,Nintendo/Nintendo bundels,1,1,Boomsjors,simple,4,PC kabels,Green,,,,Universal,1.8 Meter,,,,,,,,,,,,,,,120w,,,,,
We also had the problem that the description contains a comma and then messes up our csv.
If you need any more information, let me know!
Please make sure you are using the utf-8 encoded file format for your .csv file. This error occurs mostly with wrong formated file content.
To make it correct please open your .csv file in editor and go to 'Save As'-> Select File Type as 'MSDOS CSV(.csv)' and save.
Hope this will help...
I have uploaded the "ro_RO" folder (for roumanian language) in the 'app/locale' folder but some words are still in english. For example, in the create account form, i got the field "email" translated but the "First name" and "Last name" are still in english. The mesages generated by javascript are still in English. What more do I have to do get a full translation? (if I open the .csv files those words appears as translated)
Check the template files for strings output with __(). Those are the exact strings that need to be translated in csv