In my .csv file, I have the list of firstName and lastName. I want to use first entry in one feature file and the 2nd entry in another feature file. Is it possible to do that?
See if this helps: https://github.com/intuit/karate#calling-other-feature-files - note that you can "pass data" to other feature files.
And note that when you read a CSV file, you get JSON: https://github.com/intuit/karate#csv-files
If that does not help - then the answer is - no it is not possible to do that !
I am trying to do a VLOOKUP query into an Excel file (File 1) with about 500,000 rows from another csv file (File 2) that has about 4.5 million rows. This second file is too large to fully load in Excel, and so I am unsure how to proceed.
I am attempting to import data from File 2 to File 1 based on matching the unique PointID identifier in Column B in both files. I also have File 2 in an Access database if that works better. I have tried indicating the 'table_array' index in File 1 without opening File 2, but am receiving an error message.
Is there a way I can iterate over File 2 like a VLOOKUP without opening it or receiving an error message?
If you've already got File 2 in Access I would import File 1 into Access as well. Make sure that File 1 has its PointID set as the Primary Key, then you should be able to use an Update query in Access to get the relevant values from File 2 into File 1. You would then export the updated File 1 data back to a new Excel file (if that's where you need it to be).
I can't think of an easy way to update the original File 1 directly. It doesn't work if you add File 1 as a linked table in Access because the data isn't updateable as far as I can tell (I did try this, but I am working on older copies of Excel/Access so maybe newer versions may allow it).
I'm trying to add rows to an existing file in Talend Open Studio that already contains rows. The problem is that everytime I try to add new Rows, the job deletes the content of the csv files to replace it with the new rows.
Ex :
1st load : 500 lines in source --> 500 new lines in my .csv file. result : 500 lines in the target file.
2nd load : 30 lines in source --> 30 new lines in my .csv file. result : 30 lines in the target file, but it is supposed to be at the end of the file, and to have 530 lines.
Do you know how to do it ? Is there a way to specify the fact that I don't want to overwrite the target file ?
Am I supposed to get the data from the csv file, merge it with the new rows with a tUnite and put it in the destination file again ? (this way, the data would be overwritten with the data it contained).
in tFileOutput* component have setting called Append. if you check this option in component it will append to existing file and not overwrite it.
I want to know if it is possible to export each row from ODS file to .csv files.
For example :
column1 column2
row1 name info for the row1
row2 name info for the row2 ... and so on.
I want the exported filename to be the names from column1 and the content to be the info from column2.
Is that possible ?
To get Calc to save as .csv, each set of information needs to be on a separate sheet, not just in separate rows. I do not think it would be convenient to do this, and in any case, that will not automatically save with the correct file names.
However what you are asking can be done by creating a Python or Java macro, or perhaps JavaScript. The macro would need to read each row, and then open a file for writing with the name from column 1.
It is possible with Basic as well, but file handling in Basic is awkward.
For a good macro reference, see Andrew Pitonyak's macro document.
Prepare sheet with 2 columns:
file name
content of the file
Concatenate string "echo>" with file name in the first column
Save this sheet in .CSV format, bat with .BAT extension. In Windows it makes executable file.
Execute this batch file in terminal (command line interface). You should first change to proper directory.
DONE
I have an .HTML file that has many photos attached to it for displaying a photo gallery. I'm replacing old photos with new ones, and I'm thinking there must be a more intelligent way than simply copying and pasting repetitive file names.
I would love to be able to replace and increment a file name on each replace, starting at a base file name of my choosing. For example...
...images/69thStreet010.jpg
...images/69thStreet011.jpg
...images/69thStreet012.jpg
Basically performing a CTRL+F and REPLACE '69thStreet010.jpg' with...
...images/xyz001.jpg
...images/xyz002.jpg
...images/xyz003.jpg
And so on until I want it to stop. Anyone here have any suggestions? Thanks a lot!
UPDATE: I should also add, I'm using Notepad++ to edit my files.
Look into the Column Editor feature within Notepad++. You can do a block select on the area you want to increment and then give it a starting/ending range and you're all set.
I was in a similar situation recently. I did a little bit of regular expression search/replace to get my filenames into my "default" format with some padded "000" where I wanted my incrementing to start. After that, I used Shift+ALT to block select the 000s and used the editor to do the rest of the work.
OK, I came up with a Notepad++ solution.
It does require you to install the Notepad++ plugin PythonScript.
It is a TextPad-like incremental replace.
i.e.
Search and replace integer values within a string
replacing incrementally starting with 1 (0 is the default starting value):
In your case it would be
Search: ...images/69thStreet[0-9]+.jpg
Replace: ...images/xyz00\i(1).jpg
Install the PythonScript plugin.
Save the code below as a PythonScript and associate a shortcut (i.e. Ctrl+i) to it:
Then open your html file in Notepad++ and run the script below on your html file.
When prompted by the search replace dialogue, enter the following 2 lines:
...images/69thStreet[0-9]+.jpg
...images/xyz00\i(1).jpg
Now, all instances of
...images/69thStreet010.jpg
...images/69thStreet011.jpg
...images/69thStreet012.jpg
will become
...images/xyz001.jpg
...images/xyz002.jpg
...images/xyz003.jpg
Here is the PythonScript code
from Npp import *
import re, string
# First we'll start an undo action, then Ctrl-Z will undo the actions of the whole script
editor.beginUndoAction()
expression = notepad.prompt("Enter the search string on the first line, followed by Ctrl+Enter, \n" +
"followed by the replace string on second line",
"Incremental Search/Replace" ,
"")
expressionList = re.split(r"[\n\r]+", expression)
if len(expressionList) == 2:
foundCount = [0]
def incrementalReplace(parmReplaceStr,parmFoundCount):
varPatternI = r'\\i\((?P<starting>[0-9]+)\)'
varPatternIi = r'\\i'
varPatternISearch = re.search(varPatternI , parmReplaceStr)
if varPatternISearch != None:
varFoundCount = int(varPatternISearch.group('starting')) + parmFoundCount[0]
varReplaceString = re.sub(varPatternI ,str(varFoundCount ),parmReplaceStr)
elif re.search(varPatternIi, parmReplaceStr) != None:
varReplaceString = re.sub(varPatternIi,str(parmFoundCount[0]),parmReplaceStr)
parmFoundCount[0] = parmFoundCount[0] + 1
return varReplaceString
# Do a Python regular expression replace
editor.searchAnchor()
while editor.searchNext(0x00200000,expressionList[0]) != -1:
editor.replaceSel(incrementalReplace(expressionList[1],foundCount))
editor.lineDown()
editor.searchAnchor()
# End the undo action, so Ctrl-Z will undo the above two actions
editor.endUndoAction()
If your S&R supports Regex, use this.
Search term:
images/69thStreet([0-9]+).jpg
Replace term:
images/xyz$1.jpg
I just use Excel & Notepad++
Create a column of incrementing numbers in Excel. Then in the next (or previous) column, put in the line you wish to merge w/ the incrementing numbers. For instance:
file00 | 1 | .jpg
file00 | 2 | .jpg
Etc.
Then copy/paste the thing into Notepad++ (or use Excel's CONCATENATE function if the job is simple) and do a replacement.
It's time for you to learn scripting languages. Python/Ruby/Perl can do this in a few lines by using simple regular expressions and a directory listing.
notepad++ allows you to make multi line editing. But the main problem here is to get as quick as possible all the file names from the directory where they are.
In the past I had similar challenge that I solved this way.
This works almost on all win vers.
To make a list of all files in a directory create a bat file into the dir itself.
copy and paste there the following batch code
dir /b > filelist.txt
Save the file with name
makefilelist.bat
Not important the name you give it: the important thing is the file extension .bat
Double click on the bat file just saved: the batch script executes a clean dir command inside the directory in witch it is executed redirecting the output to the file filelist.txt
In less than one sec you have the output saved into the filelist.txt witch will be similar to the following:
filelist.txt
Image File Name 01.gif
Image File Name 02.gif
Image File Name 03.gif
Image File Name 04.gif
Image File Name 05.gif
Image File Name 06.gif
Image File Name 07.gif
Image File Name 08.gif
Image File Name 09.gif
Image File Name 10.gif
Image File Name 11.gif
Image File Name 12.gif
Image File Name 13.gif
Image File Name 14.gif
Image File Name 15.gif
Image File Name 16.gif
Image File Name 17.jpg
Image File Name 18.jpg
Image File Name 19.jpg
Image File Name 20.jpg
Image File Name 21.jpg
Image File Name 22.jpg
Image File Name 23.jpg
Image File Name 24.jpg
Image File Name 25.jpg
Image File Name 26.jpg
Image File Name 27.jpg
Image File Name 28.jpg
Image File Name 29.jpg
Image File Name 30.jpg
Image File Name 31.jpg
Image File Name 32.jpg
Image File Name 33.PNG
Image File Name 34.PNG
Image File Name 35.PNG
Image File Name 36.PNG
Image File Name 37.PNG
Image File Name 38.PNG
Image File Name 39.PNG
Image File Name 40.PNG
Image File Name 41.PNG
Image File Name 42.PNG
Image File Name 43.PNG
Image File Name 44.PNG
Image File Name 45.PNG
Image File Name 46.PNG
Image File Name 47.PNG
Image File Name 48.PNG
makelist.bat
Of course the names logged into the file list may vary... The script logs every file, no matters if it is in sequence or not or if its name is a random name or contains date time (time stamp) etc.: it logs everything is into the same dir in witch is executed...
Now you can open filelist.txt with notepad++: first delete the lines of the list that report the unwanted files:
makelist.bat
filelist.txt
This operation is necessary cause the script lists also itself and the filelist.txt.
Then with multi line editing tool add the tag around all lines at once, or everything else needed to built the photo gallery, even a javascript array, etc... in the end copy and paste the finished job to your image gallery file under coding.
Done. Easy as drinking a glass of water: it is more difficult to explain than to do! Granted. ;-)
Improvements:
It is possible to get a list of just the jpg files by modifying the batch command like the following:
dir *.jpg /b > filelist.txt
Image File Name 17.jpg
Image File Name 18.jpg
Image File Name 19.jpg
Image File Name 20.jpg
Image File Name 21.jpg
Image File Name 22.jpg
Image File Name 23.jpg
Image File Name 24.jpg
Image File Name 25.jpg
Image File Name 26.jpg
Image File Name 27.jpg
Image File Name 28.jpg
Image File Name 29.jpg
Image File Name 30.jpg
Image File Name 31.jpg
Image File Name 32.jpg
The same with other file extensions.
There is. Create your list of photos using a python script that looks at whatever directory you want, and renames or just lists all the file names. Then go from that to a python script that generates the HTML you need (should be very easy at this point). Then copy & paste that.
Python is very easy to use, you will be able to download it in 5 minutes & find a tutorial for reading / changing file names in another 10 minutes.