I have a basic informatica load. Flat file to Flat file and no transformations.
My source flat file does not have quotes.
EX: A B C D
When I run my job I get quotes.
EX: "A" "B" "C" "D"
Please help!
In the session, target file properties, you can set your preferences regarding double quote, single quote or no quote.
Set Optional Quotes to none in session, target file properties
Set File Properties
Delimited -> Advanced
Set Optional Quotes to None
Related
I have an issue in inserting data from file to target database in Informatica
The file separator used is ,
File contain below data :
a,abc "tyu",ghj
avc,jk,ghjsjs "hjk",
Data base is not accepting entire record as one string for abc "tyu" and ghjsjs "hjk"
How to resolve this so that the data comes in double quote within the single comma separated
How to apply logic at expression level to resolve this issue
I have used replace but it replace "" with null
You need to remove optional quotes from source file property.
open infa session > go to mapping tab > then go to sources and select the source > then select file properties > And you will see advanced window like this screenshot
Once you click on advanced tab, it opens window.
Make sure optional quotes is selected as 'none'.
Press ok and save the session.
Run it to test.
I have created a informatica workflow. The target is made as a flat file. The delimiter used is \037 with UTF-8 encoding, but the output file created contains , as the delimiter. It works fine with other WF's i have created.
How to get the required delimiter in the output file.
Regards
Sriram
Just check once if it is only \037 or ,\037 in delimiter. And also check the same in session in set file properties for the flat file target.
Suppose I have a file called hello.txt in a directory c:\test\, then the following runs without problems in Stata:
local folder "c:\test"
confirm file "`folder'\hello.txt"
but the following won't
local folder "c:\test"
local file "hello.txt"
confirm file "`folder'\`file'"
How do I combine more than one local into a path like c:\test\hello.txt that can be used in e.g. the confirm file command?
Thanks in advance.
The problem is that \ can act both as escape character and as part of a Windows file path.
When you type something in Stata that contains a local macro, then Stata's first action is to evaluate that macro, i.e. look at its content and replace the macro with that content. Sometimes (rarely, but it can happen) you want to prevent that. That is what an escape character is for.
So what Stata sees in your second example is
c:\test`file'
which is not a valid path.
The easiest solution is to use a / instead of a \, which results in a valid path as far as Stata is concerned and that won't act as an escape character.
For more see:
Nicholas J. Cox (2008) Stata tip 65: Beware the backstabbing backslash. The Stata Journal, 8(3): 446--447.
http://www.stata-journal.com/article.html?article=pr0042
I need to do quite a few regular expression search/replaces throughout hundreds and hundreds of static files. I'm looking to build an audit trail so I at least know what files were touched by what searches/replaces.
I can do my regular expression searches in Notepad++ and it gives me file names/paths and number of hits in each file. It also gives me the line #s which I don't really care that much about.
What I really want is a separate text file of the file names/paths. The # of hits in each file would be a nice addition, but really it's just a list of file names/paths that I'm after.
In Notepad++'s search results pane, I can do a right click and copy, but that includes all the line #s and code which is just too much noise, especially when you're getting hundreds of matches.
Anyone know how I can get these results to just the file name/paths? I'm after something like:
/about/foo.html
/about/bar.html
/faq/2012/awesome.html
/faq/2013/awesomer.html
/foo/bar/baz/wee.html
etc.
Then I can name that file regex_whatever_search.txt and at the top of it include the regex used for the search and replace. Below that, I've got my list of files it touched.
UPDATE What looks like the easiest thing to do (at least that I've found) is to just copy all the search results into a new text file and run the following regex:
^\tLine.+$
And replace that with an empty string. That'll give you just the file path and hit counts with a lot of empty space between each entry. Then run the following regex:
\s+\n
And replace with:
\n
That'll strip out all the unwanted empty space and you'll be left with a nice list.
maybe you need power of unix tools
assume you have GNUWin32 installed in c:\tools\gnuwin32
than if you have replace.bat file with that content:
#echo off
set BIN=c:\tools\gnuwin32\bin
set WHAT=%1
set TOWHAT=%2
set MASK=%3
rem Removing quotes
SET WHAT=###%WHAT%###
SET WHAT=%WHAT:"###=%
SET WHAT=%WHAT:###"=%
SET WHAT=%WHAT:###=%
SET TOWHAT=###%TOWHAT%###
SET TOWHAT=%TOWHAT:"###=%
SET TOWHAT=%TOWHAT:###"=%
SET TOWHAT=%TOWHAT:###=%
SET MASK=###%MASK%###
SET MASK=%MASK:"###=%
SET MASK=%MASK:###"=%
SET MASK=%MASK:###=%
echo %WHAT% replaces to %TOWHAT%
rem printing matching files
%BIN%\grep -r -c "%WHAT%" %MASK%
rem actual replace
%BIN%\find %MASK% -type f -exec %BIN%\sed -i "s/%WHAT%/%TOWHAT%/g" {} +
you can do regex replace in masked files recursively with output you required
replace "using System.Windows" "using Nothing" *.cs
The regulat expression I use for this kind of problem is
^\tLine.[0-9]*:.
And it works for me
This works well if you have Excel available and want to avoid using regular expressions:
Ctrl+A to select all the results
drag & drop the selected results to Excel
Create a Filter on the 1st row
Filter out the lines that have "(Blank)" on the 1st column
Select the remaining lines (i.e. the lines with the filenames) and copy/paste them to another sheet or any wanted destination
You could also Ctrl+A, Ctrl+C the search results, then use the Paste Option "Use Text Import Wizard" in Excel, say that the data is "Fixed width" and put one single break line after the 2nd character (to remove the two leading spaces in the filename during import), and use a filter to filter out the unwanted rows.
Hi I'm trying to load pipe delimited file in weka using java CSVLoader. Looks like CSVLoader only loads comma and tab. Is there a way i can change the delimiter on these loaders ?
Has anyone loaded a pipe separated file in Weka ?
Thanks,
Amit
The new version does allow you to enter a delimiter or separator using option -F option. See: http://weka.sourceforge.net/doc.dev/weka/core/converters/CSVLoader.html
Doesn't look like there are any options to give different delimiters. Just read the file first and replace pipes with commas?