Robot framework-how to replace 'list files in a directory' keyword by an .csv file containing the list of files - frameworks

I have a .csv files which contain all the files in the directory.
CSV
1,txt1.txt
2,txt2.txt
3,txt3.txt
4,txtsum.txt
These four text files and csv file are there in my directory c:/data i want to fetch the names of the files from the csv file insted of using the keyword 'list files in a directory'.

Related

Zip files using 7zip from command window

Using 7zip, I want to give a location of a folder of files something like...
D:\Home\files Then I want it to zip all the files in that folder and leave them there. So for example zipme.txt become zipme.zip, so all files would keep their name but just become a zip file. I have tried to use
FOR %i IN (D:\Home\files) DO 7z.exe a "%~ni.zip"
But when I do it it adds a zip file for the directory so my output would be in the correct folder but would contain
D:\Home\files\file.zip
D:\Home\files\zipme.zip
zipped files also all items in directory like..
zipme.txt
zipme2.txt
D:\Home\files/zipme2.zip
So how can I zip each file individual in a folder and have the new zipped name be the individual files name
Was able to get this to work.
FOR %i IN (D:\Home\files\*) DO 7z.exe a "%~ni.zip" "%i"

how to get all csv files in tar directory that contains csv.gz directory using scala?

I have the following problem: suppose that I have a directory containing compressed directories .tar which contain multiple file .csv.gz. I want to get all csv.gz files in the parent compressed directorie *.tar. I work with scala 2.11.7
this tree
file.tar
|file1.csv.gz
file11.csv
|file2.csv.gz
file21.csv
|file3.csv.gz
file31.csv
I want to get from file.tar a list of files : file1.csv.gz , file2.csv.gz file3.csv.gz so after that a can create dataframe from each file csv.gz to do some transformation.

Copy .csv files in to one file with file name printed to allinone.csv

I have been given a data extract dump from an Oracle DB (cc&b). Each extract comes with a .log file which gives a table def, pk, fk, data types etc. I want to copy all these files in to one. I aware of the MS-Dos command
'copy *.log allinone.txt'
My problem is the content of the .log files do not contain the table name; the table name only exists on the file name. I need the table name printed in the allinone.txt file.
There are 486 tables so manual is not really ideal. Is there way to Print File Name + Content?
I'm assuming you are really using Windows, and not MS-DOS.
I'm also assuming all the .log files are in the same folder.
No batch file is required. Simply CD to the folder with the log files. Then run the following command:
type *.log >combinedLog.txt 2>&1
The TYPE command will include the file name at the top of each file output when a single command types multiple files. The file name is printed to stderr, so stderr is redirected to stdout (2>&1).

How to use xcopy to select specific folders(Not Files) within another folder

I am trying to xcopy specific folders from some directory to another folder, problem is i don't want to copy all the folders but i want specific folders. E.g. DirectorySource has folders (folderA,folderB,folderC) but i want to copy folderA and folderB only to DirectoryDestination.
Create a text file, say C:\excludes.txt with the following contents:
DirectorySource\folderC\
then you can copy:
xcopy DirectorySource DirectoryDestination /s /i /exclude:C:\excludes.txt
The file excludes.txt contains a list of strings, one per line. If a file or directory matches that string, then it will not be copied. If you want to exclude folder, it is safer to use the above string instead of simply folderC, which might skip a file called folderC_listing.txt

How can I reorganize a directory structure in Perl?

I am writing a script for renaming/copying the content of a file.
I have temp & temp1 folders. Inside temp1 I have 1,000 .txt files with names 1.txt, 2.txt, 3.txt ... & in temp folder I have sub directories named 1, 2, 3.
In the folders 1, 2, 3 ..., I have one file with extension java or xml.
My need is to automate the copy of the contents of the .txt file, and paste into the respective file in the temp sub directory. Is it possible to do this using Perl?
Please see perldoc -f rename. You can rename files in a loop.