Create folders and move files by reading csv

Hello guys,.

That can create a script to read csv and create folders and move files into the folder.

My csv will look like

Screen Shot 2015-11-11 at 5.25.29 PM.png

There the names of folders and file names, I kept my files (Mention in the 'File name' column) in the office. When I run the script it must read the csv file and create the folder (depending on the "folder names") and the correct file must move in the particular folder. Hope I have clear requirements.

So we need 4 above csv files and the respective files must travel in their records. Need help!

Thing may have changed as I've tested with CS6.

Please try then.

#target photoshop;
main();
function main(){
var csv = File.openDialog("Please select CSV file.","CSV File:*.csv");
if(csv == null) return;
var sourceFolder = Folder.selectDialog( "Please select source folder");
if(sourceFolder == null) return;
var data=[];
csv.open('r');
while(!csv.eof){
var InputLine = csv.readln();
if(InputLine.length > 3) data.push(InputLine);
}
csv.close();
for(var f in data){
var dataLine = data[f].split(',');
var folderName = dataLine[0].toString().replace(/^\s+|\s+$/g,'');
var fileName = dataLine[1].toString().replace(/^\s+|\s+$/g,'');
var file = File(sourceFolder + "/" + fileName);
if(!file.exists) continue;
var outputFolder = Folder(sourceFolder + "/" + folderName);
if(!outputFolder.exists) outputFolder.create();
if(file.copy(outputFolder + "/" + fileName)) file.remove();
    }
alert("All Completed");
};

Tags: Photoshop

Similar Questions

  • How to create folders and move photos in the image library?

    I just bought a new laptop and am new to windows 8. I downloaded approximately 300 pictures and they all saved in the library of photos in the same folder. I can't work out how to create separate folders or even how to move one of the photos. They appear only as a long line of scrolling which is a real pain. Is it possible to create folders and move the photos where I'm supposed to to store another app that sort of thing? Sorry if this question has been asked, but I couldn't find the answer I was looking for. Any help would be appreciated...

    the classic Office Explorer/libraries to manage the folder structure.
    create folders, to necessary, add to the library, if necessary.
     
     
    Barb
     
     
     
     
    Please mark as answer if that answers your question
     
     
     
     
  • What has changed on my computer? I was able to create folders and can no more do this...

    What has changed on my computer? I was able to create folders and can no more do this... I have Windows 7 with Microsoft Office Home and Business 2010... before uninstalling some software yesterday, I could create a new folder. now I can create is no longer a new folder.

    How can I solve this problem?
    Thank you

    Hello Annette,.

    It is a problem for a long time under Windows 7. To solve it I recommend that you only install the following program - FileMenu Tools. You can download the portable freeware from here: http://www.softpedia.com/get/PORTABLE-SOFTWARE/System/System-Enhancements/FileMenu-Tools-Portable.shtml .

    After having downloaded and installed the program, you will notice that, by default, each option is checked. I would be much more selective on this subject, otherwise your context menu will be a full page long! When the main window opens, you will see a list on the right side of all the elements that can be added to the context menu. Start weeding through the list and every one to take away, you don't need the United Nationsby checking the box.

    Once you have completed your selection (de-selections) make sure that you click the green check mark in the row of icons at the top of the left window of the interface to 'Apply' of your choice. The program can do much more, but that answers your specific question. I am told that the program has a good help file, so try here if you are interested.

    Let me know if this solves the problem for you.

    Kind regards

    BearPup

  • Bookmarks Manager no longer exists on 7.01. How to create folders and organize my favorites?

    Bookmarks Manager no longer exists on 7.01. How to create folders and organize my favorites?

    I don't use a Mac, but I think it is similar. Organize bookmarks, is renamed the show all bookmarks option.

  • I want to rename and move files from a shoot 5 d. I would like to use the functionality of the increment to count, but since I have to get out of each file to the following file, it starts again at 1. What is the best way to do it?

    I want to rename and move files from a shoot 5 d on a new drive. I would like to use the functionality of the increment to count, but since I have to get out of each file to the following file, it starts again at 1. What is the best way to do it?

    HI -.

    As a prelude to 2014.0, we have added a feature allowing you to choose what number to start the increment of.  Look in the section ingest Rename dialog and change your preset. When you click the button, you should see the option "Custom Auto Increment". This will allow you to choose what number to start on.  We've also added a few newspapers to try to remember where let prelude last successfully interfere the operation by using this option. So, in theory, to remember the number for you. But if it isn't (maybe you want multiple kickoff ingested at the same time) you can always manually set the number to start with.

    Check that out and let me know how it works for you.

    Kind regards

    Michael

  • .mp4 and .mov files are just BIG

    Sorry, without posting the details of encoding, is there an obvious reason why my .mp4 and .mov files are ~ 10 x the size they should be after the SOUL? I'm talking about 300mb.mov and 30 MB .mp4 before later files. If you need details, I'll post. Thank you.

    File size is determined mainly by only two factors - length and bitrate.  The used codec, resolution, frame rate, etc. all have little or no effect on the size of the file.

    Length and bitrate.  If you want a smaller file, one or other of the people must be reduced.

  • Disable copy and move files/folders in windows xp

    I want to warn the user domain to copy files or folders in windows xp

    You can't avoid it.

    There are other things you can do:

    • Enable auditing of file to their computers so that Windows saves which copy / move the files where on this computer.
    • Use NTFS permissions to prevent user access to folders and files, they do not have the authorization to do so.
    • Sticks to use Group Policy to prevent the use of USB.
  • External hard drive creates folders and files and lose the music I synced to it.

    I've been struggling with my 8 GB Clip +, which is the same thing my old 4 GB Clip + has. It creates files SID and incorporate in the album folders. Renamed it with records of the characters of 8 or 9 (alpha and digital) at the beginning of the file name, and some of the music I download does not exist when I disconnect the player and it refreshes. It does this for MP3 AND WMA files, if I use Media Player or Windows Explorer.

    I loaded all my WMA files on the internal hard disk (that works absolutely perfect), responsible for MP3s ONLY on the external hard drive and got the same result. The external hard drive has been reformatted, there is no debris of what anyone to spoil things. Any ideas would be greatly appreciated.

    Thank you!

    So after spending most of my Sunday with my 8 GB Clip + and its 8GB external drive, I found that the problems mentioned previously disappear if opt you for USB mode MSC. I was then able to transfer MP3 and WMA using Windows Media Player or Windows Explorer. I even got to explore open and hung out and deposited the files in window Media Player sync. Very Cool! Also, when I tried to copy something that she already had, he said that the case was already transferred. Amazing! In the past, it should continue to record the same.

    Although I must say that a WMA file problem: some of the music files were not correctly identified and is not 'stick' to the albums they came from. But a search for individual songs revealed they were always there, even if the Sansa could not "identify the album they belong to.

    I hope this helps others. At the end of the day, my advice is: If you have an external drive, the USB MSC mode, and you won't have any major problems - just a few small, boring ones.

    And thanks for the two of you who responded to my original post. Yes, the player has been on auto-detection mode - not good.

  • BatchLoader to create folders and files of consignment

    I want to check-in my folder structure on my file system in the Complutense University of MADRID.
    I am not able to understand how to create the folder using BatchLoader structure.

    I am able to create a folder using IdcCommand, but to create the subfolder that I need the dParentCollectionID, how do I know the 'dCollectionID' of the folder I just
    created from command line.

    After creating folders in UCM how should we indicate the name of the folder in my batchscript file that I can use in BatchLoader to transfer my files to the corresponding folders in the Complutense University of MADRID.

    Please give some suggestions.

    Thank you
    Mahendra

    Hi change dCollectionID to xCollectionID

    Kind regards
    Deepak

  • Imported. MOV file is read in the very small edit section?

    I have some footage of a camera flip video original that I converted a. Via Wondershare MOV file. I imported images in my first Pro CC and it reads back end/normal size in the preview area, however once in my edition track play almost 1/8 normal size (incredibly narrowed down into a small square).

    Why is that happening and how can I solve this problem? The video is 640 x 480 (1.0). I guess I just need to understand how to "resize" or expand my pictures in Premiere Pro or a compatible program outside the first.

    I'm completely deficit right now and I'm very stressed on this subject! Thanks for any help.

    Hi katharineroman,

    Do you have other clips playing in the HD size sequence? If so, right-click (Ctrl click on Mac) on the element in the timeline panel and choose "Scale with the size of the image."

    If all the clips of this size, make a sequence that corresponds to the size of the clamp. right click (control click on Mac) on the clip, and then choose "new sequence of the Clip.

    Thank you

    Kevin

  • Created by external computer files are read only on the file server.

    Is not a question of indesign, but have searched and searched but cannot find an answer, hoping that someone here had the same problem and find out if it can be fixed.

    Systems:

    MacPro running snow lepoard as the file server

    iMac, read and write files in the Macpro have access to shared files.

    Problem:

    When the iMac saves any type of file, or create directories everything the iMac on the Macpro system is read only the user to Macpro.

    Only solution so far has been to give the iMac user an admin on the MacPro account, then everything they create is not read-only.

    It works but it's not the best of ideas for them to access the system files and you have.

    Is there a way to make the iMac to create files that are not read only without obtaining the server version of Mac OS x or giving them administrative rights to the Macpro.

    For any idea or suggestion would be great

    Thank you

    Problem solved!

    All this is down to the property not sharing or perrmissions.

    For anyone who would need to know:

    in the dialog box get info select "property to ignore on this volume."

    tonyharmer:

    You right where people above in the apple forums where it is very useful

  • Why is Clip Zip rename my folders and music files?

    Original Windows folder:

    Billboard Greatest Christmas Hits (1935-1954)

    Name of the Zip clip:

    09100000_Billboard more great Christmas

    This occurs intermittently in many places.

    1 copy the files and songs (mp3) directly on the device using Windows Explorer in Windows 7 Pro.

    2. check the folders and songs appear as they should (using Windows Explorer).

    3 unplug the unit and let it cool off.

    4 browse music on the device, and Note Renaming wandering some songs and records.

    5. reconnect the device to the computer via the USB port.

    6. check with the Windows Explorer that stray names are there as previously played on the device, and NOT what I put there.

    How to stop?

    It is a Zip Sansa Clip 8 GB with a SanDisk 32 GB microSDHC Mobile extra card and using Windows 7 Pro.

    Turn the player in MSC mode. It is in the Control Panel, USB mode.

  • Eclipse create .jad and .cod files

    According to the documentation I've seen, OTA installation from a Web site is to place the files application.jad and application.cod on a server to direct the BlackBerry device to this location.  My preliminary test indicate that it works as advertised.

    However, I find that Eclipse creates an application.jad file that references a request file - 1.cod, but at the same time only creates the file application.cod.  Of course, when the device will the url and inspects the .jad file, it tries to find the file application - 1.cod!

    What is causing this to happen and how I fix without manually open the .jad file and inspect everything I want to publish?

    Thank you

    Ouch!

    I looked at me directory and of course, the cod file was more than 64K.  If you tell me that once it is greater than 64K isn't really a cod file, but in fact a zip file?  To deploy, I need to decompress the file and place the actual cod files in my site url?

    I was skeptical, but it seems to be as you described.

    Thank you for sharing this tidbit.

  • Make folders and private files

    I guess that means that only people using my computer can access these files or that it means that they are protected by Word?

    This means that only your user can access your My Documents folder and the files it contains. Other users of the system will be denied access. MS - MVP - Elephant Boy computers - don't panic!

  • BlackBerry Smartphones help please! I can not open E: / / or F: / / readers and I can sync folders and media files

    Hello world! I got my BlackBerry Torch 9800 on 6 September. On 8 September, I tried to synchronize media files and it was not work. I opened the back cover and there is no MicroSD card. I return to the TELUS store on 16 September and they give me the microSD card. I put it in my cell phone. When I go into Options - devices - storage, the "enable compression" and "media card" are controlled. I see the applications-free space 286,5 MB storage, integrated Total media storage and 3.5 GB of free space and storage card Media-Total and free 7.3 GB. I have also format and fix them both. I try to remove/replace my Media Cardin, to remove/replace my cell phone battery, there is nothing to do. Whatever I do, I can not open E:: / / or F: / / readers (I have new for formatting, I try and it does not work) and I can't synchronize the folder and multimedia files. I see a time "the memory of the device and the media are unavailable because the mass storage is in use". I use the v6.0.0.448 version.

    It is correct. I have rename E: / / and F: / / and it's work.

Maybe you are looking for

  • AirPlay guard swinging back on iPhone

    I do not have wifi, but it worked before. I plugged my phone the business center to my apartment complex and is where it seems to go haywire. Now, it does not connect. WiFi on but not connected, it's Bluetooth. Still no connection. AirPlay on my phon

  • I lost my 1 of 3 applications/drivers CD Satellite 2435 series and recovery

    Does anyone have the 1 of 3 recovery cd? I can't find me and I'm in trouble! Please, I beg you. AYUDA!

  • Can not turn off my drive

    I have a sansa e280 When I turn it on it says "refreshing database" and then freezes. He can't do anything about that event turn off. After many hours, it will automatically turn off, but when I connect with my computer it comes on and says "refresh

  • No identifiable icon appeared on the screen

    When you place the cursor on the icon, it says "Remove hardware" he seems to aim the driver for my hard drive.  Can I safely delete it.  I'm afraid that my grandchildren can accidentally click on it, and I don't know what it is actually.

  • SQLCL - retrieves different number of lines based on the style of SQL

    SQLcl: Release 4.1.0 Release Candidate on Tue Jul 14 10:24:05 2015 Copyright (c) 1982, 2015, Oracle.  All rights reserved. I need spool on CSV for 2 SQL statements for a thorough comparison. So, my appearance of SQL statements like this, set sqlforma