"Neo.ClientError.Statement.ExternalResourceFailed" and then placed in Import folder and still no output - csv

S1. Entered the script got error as above
S2. [enter image description here]
(https://i.stack.imgur.com/dTHuh.png)enter image description hereenter image description here
enter image description hereenter image description here
The file was executed but no nodes or relationships were created and the output came as "(no changes, no records)"

can you return the rows from csv file and check if there are rows present?
LOAD CSV WITH HEADERS FROM "file:///saphitechifregv1.csv" as line RETURN line
and then check if your where condition matches!
Thanks!

Related

Unable to match csv column name using load records from file

I have created a new screen where I'm uploading Amazon orders from a CSV file. The original CSV file downloaded needs to have the first few lines removed to have the column headings at the top.
Before
After
I have a data field on the screen called date/time, but when I upload the CSV the mapping finds some sort of hidden characters in the file so the mapping doesn't automatically map the field.
I have tried changing the encoding while uploading the file, as well as changing the display name to include the ??? and double quotes like the image below, but the field doesn't auto-map.
Is there someway to get the field to auto-map on the file upload so the user doesn't have to map the field manually?
Thanks,
Kurt Bauer

How to get the csv alias for a thread in Jmeter sharing mode current thread?

Here is my test plan structure.
User Login
Runtime Controller
while controller !<> EOF
CSV dataset (items to add)
search and add to cart
Click cart.
Proceed to check out
Order submit.
Beanshell sampler to close CSV
User Logout.
I want each thread to read the csv till EOF and add these items to cart, hence I used the sharing
mode as current thread.Since add to cart and order submission is getting repeated for the test
duration I am closing the file and resetting the variable after order submit so that next iteration
will again start to read from beginning.
The beanshell code is :
import org.apache.jmeter.## Heading ##services.FileServer;
FileServer.getFileServer().closeFile("Scripts_Helan\\DSOrderParts.csv");
String pPartNum = vars.get("pPartNum");
vars.put("pPartNum", "");
But when I run the test Jmeter log is showing file name as
Stored: Scripts_Helan\DSOrderParts.csv Alias: Scripts_Helan\DSOrderParts.csv#1309262272
Don't I have to use the Alias in closeFile? How can I get it?[enter image description here][1]
[enter image description here][1]
I don't exactly get why you are using beanshell code here.
You can handle the "start all over when done" part with setting up the Thread Group accordingly
You can handle that "stop thread at end of file" part with setting up the CSV Data Set Config accordingly
Please clarify what makes handling the file in beanshell code neccessary.

how to load extracted file name into sql server table in SSIS

i have 3 csv files in a folder which contains eid, ename, country fields, and my 5 csv files names are test1_20120116_034512, test1_20120116_035512,test1_20120116_035812 etc.. my requirement is I want to take lastest file based on timne stamp and modified date, which i have done. Now i want to import the extracted file name into destination table..
my destination tables contains fields like,
filepath, filename, eid, ename, country
I have posted regarding this before in the same site i got an answer for extracting filename, now i want to load the extracted FileName into destination table
Import most recent csv file to sql server in ssis
my destination tables should have output as
C:/source test1_20120116_035812 1234 tester USA
In your DataFlow task, add a Derived Column Transformation. The value of CurrentFile will be the fully qualified path to the file. As you only want the file name, I would look to use a replace function on that with the base folder and then strip the remaining slash. This does not strip the file extension but you can add yet another call to REPLACE and substitute an empty string
Derived Column Name: filename
Derived Column:
Expression: REPLACE(REPLACE(#[User::CurrentFile], #[User::RootFolder], ""), "\\", "")
The above expects it to look like
CurrentFile = "C:\source\test1_20120116_035812.csv"
RootFolder = "C:\source"
Edit
I believe you've done something in your approach that I did not do. You should see a warning about possible truncation but given the values discussed in this and the preceding question, I don't believe the 4k limit on expressions will be of concern.
Displaying the derived column
Demonstrating the derived column does work
I will give you a +1 for providing an approach I wasn't aware of, but you'll still need to add a derived column to match your provided format (base path name)
Full path is provided from the custom properties. Use the above REPLACE section to remove the path info except use the column [FileName] instead of #[User::CurrentFile]
I tried to get the filename through the procedure which Billinkc has given, but its throwing me error stating that filename column failed becaue of truncation error..
Any how i tried different approach to load file name into table.
steps i have used
1. right click on flat file Source and click on show advanced edito for Flat file
2. select component Properties tab
3. Inside that Custom Properties section ---> it has a property FileNameColumnName
I have assigned Filename to that column property like
FileNameColumnName----> FileName thats it, am able to get the filename into my destination table..

Issue with Flat file connection manager

I have build an SSIS package to update Oracle database from the data which is coming in Flat Files.This file contains 4 columns part of which shown below:
Airwaybill No Shipper's Ref. No. PU Date courier name
43737729582 30035024201100 13/05/2011 bluedart
43737729571 30035065201100 13/05/2011 bluedart
43737729560 30035029201100 13/05/2011 bluedart
43737729416 30033277201100 13/05/2011 bluedart
43737729420 30033297201100 13/05/2011 bluedart
These flat files are Tab Delimited.My Package Iterates through them and execute them one by one.
My Problem is that I need to press Reset Column on the columns info for each file in the flat file connection manager,than only that file is getting executed otherwise the next line data is getting clubed with last column and getting errored out
Please help me as because if this I am not able to automate my package.
All these text files are being generated from excel sheet by saving them as text delimeted files.
I would suggest the following steps to verify that the data in the flat file is indeed tab delimited and ends with the row delimiter that you have configured in SSIS.
Install the software Notepad++ on your machine. Notepad++ download url.
After you save the Excel file as tab delimited file, open the tab delimited file in Notepad++.
In Notepad++, select the menu View --> Show Symbol --> Show All Characters as shown in screenshot #1.
Orange arrows represent tabs. If you notice dots/periods (.) in orange color, those represent spaces. CR text in black background represents Carriage Return. LF text in black background represents Line Feed.
Make sure the file looks as shown in screenshot #2.
If the file looks correct, then in the SSIS package's file connection manager make sure that the row delimiter is {CR}{LF} and the column delimiter is Tab {t}. Refer screenshot #3.
Hope that helps.
Screenshot #1:
Screenshot #2:
Screenshot #3:

Find/Replace but Increment Value

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.